feat: enforce exact number of positionals instead of a minimum

This commit is contained in:
Marc 2024-08-02 17:38:00 -04:00
parent d519aa4cd1
commit fcaea8c753
Signed by: marc
GPG key ID: 048E042F22B5DC79

View file

@ -33,7 +33,7 @@ var cli = &cobra.Command{
var execute = &cobra.Command{ var execute = &cobra.Command{
Use: "execute [workflow-file]", Use: "execute [workflow-file]",
Short: "Executes the provided workflow.", Short: "Executes the provided workflow.",
Args: cobra.MinimumNArgs(1), Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
config := cmd.Context().Value("config").(*commands.Configuration) config := cmd.Context().Value("config").(*commands.Configuration)
@ -47,7 +47,7 @@ var execute = &cobra.Command{
var validate = &cobra.Command{ var validate = &cobra.Command{
Use: "validate [workflow-file]", Use: "validate [workflow-file]",
Short: "Validates the structure of the provided workflow.", Short: "Validates the structure of the provided workflow.",
Args: cobra.MinimumNArgs(1), Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
config := cmd.Context().Value("config").(*commands.Configuration) config := cmd.Context().Value("config").(*commands.Configuration)