Allow commands to explicitly state if they do, or do not take arbitrary arguments
Check that arguments are in ValidArgs If a command defined cmd.ValidArgs check that the argument is actually in ValidArgs and fail if it is not.
This commit is contained in:
committed by
Albert Nigmatzianov
parent
715f41bd7a
commit
d89c499964
@ -117,6 +117,8 @@ func TestBashCompletions(t *testing.T) {
|
||||
// check for filename extension flags
|
||||
check(t, str, `flags_completion+=("_filedir")`)
|
||||
// check for filename extension flags
|
||||
check(t, str, `must_have_one_noun+=("three")`)
|
||||
// check for filename extention flags
|
||||
check(t, str, `flags_completion+=("__handle_filename_extension_flag json|yaml|yml")`)
|
||||
// check for custom flags
|
||||
check(t, str, `flags_completion+=("__complete_custom")`)
|
||||
|
Reference in New Issue
Block a user