Skip to content

Conversation

@natecook1000
Copy link
Member

This prints the usage info if you run utils/run-test without any arguments.

$ utils/run-test
usage: run-test [-h] [-v] [--build-dir PATH] [--build {true,verbose,skip}]
                [--target TARGETS]
                [--mode {optimize_none,optimize,optimize_unchecked,only_executable,only_non_executable}]
                [--subset {primary,validation,all,only_validation,only_long}]
                [--param PARAM] [--result-dir PATH] [--lit PATH]
                [PATH [PATH ...]]
run-test: error: too few arguments

@natecook1000
Copy link
Member Author

@swift-ci Please smoke test

paths = args.paths
if not paths:
parser.print_usage()
error_exit("error: too few arguments")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: is this error even needed anymore now that we show the usage? It seems redundant

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, but I didn't want to change the output status of the command in case it's being used by something else.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well-behaved commands show usage when invalid arguments or --help is passed, and exit with nonzero result when the arguments are invalid.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dabrahams Since this command requires at least one argument, I'm considering no arguments to be invalid. Okay to merge?

@dabrahams dabrahams merged commit f951330 into swiftlang:master Mar 25, 2017
@natecook1000 natecook1000 deleted the nc-runtest-msg branch April 2, 2017 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants