diff --git a/cmd/fmt/fmt.go b/cmd/fmt/fmt.go index 0dddd04..972cb34 100644 --- a/cmd/fmt/fmt.go +++ b/cmd/fmt/fmt.go @@ -10,7 +10,7 @@ func NewCommand() *cobra.Command { return &cobra.Command{ Use: "fmt", Short: "Format a .env file", - Args: cobra.NoArgs, + Args: cobra.ExactArgs(0), GroupID: "manipulate", RunE: func(cmd *cobra.Command, args []string) error { filename := cmd.Flag("file").Value.String() diff --git a/cmd/groups/groups.go b/cmd/groups/groups.go index f961b32..025dbc4 100644 --- a/cmd/groups/groups.go +++ b/cmd/groups/groups.go @@ -15,7 +15,7 @@ func NewCommand() *cobra.Command { return &cobra.Command{ Use: "groups", Short: "Print groups found in the .env file", - Args: cobra.NoArgs, + Args: cobra.ExactArgs(0), GroupID: "output", RunE: func(cmd *cobra.Command, args []string) error { filename := cmd.Flag("file").Value.String() diff --git a/cmd/json/json.go b/cmd/json/json.go index 4baa465..38ae374 100644 --- a/cmd/json/json.go +++ b/cmd/json/json.go @@ -12,7 +12,7 @@ func NewCommand() *cobra.Command { return &cobra.Command{ Use: "json", Short: "Print as JSON", - Args: cobra.NoArgs, + Args: cobra.ExactArgs(0), GroupID: "output", RunE: func(cmd *cobra.Command, args []string) error { filename := cmd.Flag("file").Value.String() diff --git a/cmd/print/print.go b/cmd/print/print.go index 15f4d41..b2773a7 100644 --- a/cmd/print/print.go +++ b/cmd/print/print.go @@ -14,7 +14,7 @@ func NewCommand() *cobra.Command { cmd := &cobra.Command{ Use: "print", Short: "Print environment variables", - Args: cobra.NoArgs, + Args: cobra.ExactArgs(0), GroupID: "output", RunE: runE, } diff --git a/cmd/update/update.go b/cmd/update/update.go index c35b974..7cd0625 100644 --- a/cmd/update/update.go +++ b/cmd/update/update.go @@ -22,7 +22,7 @@ func NewCommand() *cobra.Command { Use: "update", Short: "Update the .env file from a source", GroupID: "manipulate", - Args: cobra.NoArgs, + Args: cobra.ExactArgs(0), RunE: runE, } diff --git a/cmd/validate/validate.go b/cmd/validate/validate.go index 26749d1..0d47611 100644 --- a/cmd/validate/validate.go +++ b/cmd/validate/validate.go @@ -17,7 +17,7 @@ func NewCommand() *cobra.Command { Use: "validate", Short: "Validate an .env file", GroupID: "output", - Args: cobra.NoArgs, + Args: cobra.ExactArgs(0), RunE: runE, }