forked from kolide/fleet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scaffold the login command (kolide#1748)
- Loading branch information
Showing
3 changed files
with
72 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/go-kit/kit/log" | ||
"github.com/go-kit/kit/log/level" | ||
"github.com/urfave/cli" | ||
) | ||
|
||
func setupCommand() cli.Command { | ||
var ( | ||
flAddress string | ||
) | ||
return cli.Command{ | ||
Name: "setup", | ||
Usage: "Setup a Kolide Fleet instance", | ||
UsageText: `fleetctl config login [options]`, | ||
Flags: []cli.Flag{ | ||
cli.StringFlag{ | ||
Name: "address", | ||
Value: "", | ||
Destination: &flAddress, | ||
Usage: "The address of the Kolide Fleet instance", | ||
}, | ||
}, | ||
Action: func(cliCtx *cli.Context) error { | ||
logger := log.NewLogfmtLogger(os.Stdout) | ||
level.Info(logger).Log("msg", "setting up fleet") | ||
return nil | ||
}, | ||
} | ||
} | ||
|
||
func loginCommand() cli.Command { | ||
var ( | ||
flAddress string | ||
) | ||
return cli.Command{ | ||
Name: "login", | ||
Usage: "Login to Kolide Fleet", | ||
UsageText: `fleetctl config login [options]`, | ||
Flags: []cli.Flag{ | ||
cli.StringFlag{ | ||
Name: "address", | ||
Value: "", | ||
Destination: &flAddress, | ||
Usage: "The address of the Kolide Fleet instance", | ||
}, | ||
}, | ||
Action: func(cliCtx *cli.Context) error { | ||
logger := log.NewLogfmtLogger(os.Stdout) | ||
level.Info(logger).Log("msg", "logging in to fleet") | ||
return nil | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters