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:
Eric Paris
2015-06-09 14:17:58 -04:00
committed by Albert Nigmatzianov
parent 715f41bd7a
commit d89c499964
4 changed files with 157 additions and 22 deletions

View File

@ -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")`)