diff --git a/README.md b/README.md index 940c139..ca0d5e3 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,6 @@ $ awsmfa [options] [token-code] --serial-number string AWS serial number. `--serial-number` is required ---token-code string - Device token codes issued by the MFA. `--token-code` option or `token-code` is required - --quiet bool if enabled, log is not printed in the console. (default `false`) ``` diff --git a/cmd/awsmfa/main.go b/cmd/awsmfa/main.go index d6e4855..c9a6fdf 100644 --- a/cmd/awsmfa/main.go +++ b/cmd/awsmfa/main.go @@ -41,10 +41,6 @@ func main() { Name: "serial-number", Usage: "AWS serial-number", }, - &cli.StringFlag{ - Name: "token-code", - Usage: "AWS MFA token", - }, &cli.BoolFlag{ Name: "quiet", Usage: "log print disable", diff --git a/config.go b/config.go index baaa405..815ab05 100644 --- a/config.go +++ b/config.go @@ -42,12 +42,9 @@ func NewConfig(c *cli.Context) (*Config, error) { return nil, errors.New("--serial-number is required") } - mfaTokenCode := c.String("token-code") + mfaTokenCode := c.Args().First() if mfaTokenCode == "" { - mfaTokenCode = c.Args().First() - } - if mfaTokenCode == "" { - return nil, errors.New("--token-code or token arguments is required") + return nil, errors.New("[token-code] arguments is required") } client := sts.New(session.Must(session.NewSessionWithOptions(session.Options{