Skip to content

Commit 9f4a04e

Browse files
committed
update deprecation comments
1 parent f477cb9 commit 9f4a04e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

args.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,17 @@ func RangeArgs(min int, max int) PositionalArgs {
7676
}
7777
}
7878

79-
// ExactValidArgs is DEPRECATED. Use ExactArgs instead.
79+
// ExactValidArgs returns an error if there are not exactly N positional args OR
80+
// there are any positional args that are not in the `ValidArgs` field of `Command`
81+
//
82+
// Deprecated: now `ExactArgs` honours `ValidArgs`, when defined and not empty
8083
func ExactValidArgs(n int) PositionalArgs {
8184
return ExactArgs(n)
8285
}
8386

84-
// OnlyValidArgs is DEPRECATED. Use ArbitraryArgs instead.
87+
// OnlyValidArgs returns an error if any args are not in the list of `ValidArgs`.
88+
//
89+
// Deprecated: now `ArbitraryArgs` honours `ValidArgs`, when defined and not empty
8590
func OnlyValidArgs(cmd *Command, args []string) error {
8691
return ArbitraryArgs(cmd, args)
8792
}

0 commit comments

Comments
 (0)