Skip to content

Commit

Permalink
fix: passes arguments through flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Zhu committed Dec 20, 2021
1 parent 0608d06 commit 0eac4f5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@ func commands() {
Name: "list-profiles",
Aliases: []string{"ls-p"},
Usage: "List profiles under an account",
Flags: []cli.Flag{
&cli.StringFlag{Name: "account-id", Required: true},
},
Action: func(c *cli.Context) error {
accountId := c.Args().Get(0)
accountId := c.Value("account-id")
token, err := GetAwsSsoToken(domain)
if err != nil {
log.Fatalln(err)
Expand All @@ -87,9 +90,13 @@ func commands() {
Name: "access",
Aliases: []string{"access"},
Usage: "Access AWS Resource with a profile",
Flags: []cli.Flag{
&cli.StringFlag{Name: "account-name", Required: true},
&cli.StringFlag{Name: "profile-name", Required: true},
},
Action: func(c *cli.Context) error {
accountId := c.Args().Get(0)
profileName := c.Args().Get(1)
accountId := c.Value("account-name")
profileName := c.Value("profile-name")
token, err := GetAwsSsoToken(domain)
if err != nil {
log.Fatalln(err)
Expand Down

0 comments on commit 0eac4f5

Please sign in to comment.