Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update error message for invalid subcommand usage #1029

Merged
merged 2 commits into from Aug 15, 2017

Conversation

bamarni
Copy link
Contributor

@bamarni bamarni commented Aug 8, 2017

3e66e12 added an explicit error message for invalid subcommand usage.

This change rephrases it to make it clear that the subcommand exists but is being misused.

https://jira.mesosphere.com/browse/DCOS_COMMUNITY-95

@bamarni bamarni force-pushed the dcos-community-95 branch 2 times, most recently from 31602f1 to aab6a2d Compare August 11, 2017 09:20
3e66e12 added an explicit error message
for subcommand invalid usage.

This change rephrases it to make it clear that the subcommand exists but
is being misused.

https://jira.mesosphere.com/browse/DCOS_COMMUNITY-95
@@ -23,7 +23,7 @@ def wrapper(*args, **kwargs):
try:
result = func(*args, **kwargs)
except docopt.DocoptExit as e:
emitter.publish("Command not recognized\n")
emitter.publish("Invalid subcommand usage\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the standard response? What do other subcommands say here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would be this same message for all subcommands if they are misused (auth, job, etc.), this is only different for subcommands which have their own binary, where the behaviour depends on the executable I think.

Some examples :

(dcos-cli/cli) ➜  cli git:(dcos-community-95) dcos auth
Invalid subcommand usage

Usage:
    dcos auth --help
    dcos auth --info
    dcos auth --version
    dcos auth list-providers [--json]
    dcos auth login
        [--provider=<provider_id>] [--username=<username>]
        [--password=<password> | --password-file=<password_file>
        | --password-env=<password_env> | --private-key=<key_path>]
    dcos auth logout
(dcos-cli/cli) ➜  cli git:(dcos-community-95) dcos job --invalid
Invalid subcommand usage

Usage:
        dcos job --config-schema
        dcos job --help
        dcos job --info
        dcos job --version
        dcos job add <job-file>
        dcos job remove <job-id> [--stop-current-job-runs]
        dcos job show <job-id>
        dcos job update <job-file>
        dcos job kill <job-id> [<run-id>][--all]
        dcos job run <job-id> [--json]
        dcos job list [--json]
        dcos job schedule add <job-id> <schedule-file>
        dcos job schedule show <job-id> [--json]
        dcos job schedule remove <job-id> <schedule-id>
        dcos job schedule update <job-id> <schedule-file>
        dcos job show runs <job-id> [--run-id <run-id>][--json][--q]
        dcos job history <job-id> [--json][--show-failures]

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool. It would be good to have a common string abstracted out for this, but we can leave this as future work.

@klueska klueska merged commit 4397839 into dcos:master Aug 15, 2017
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.

None yet

2 participants