{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/30727","repository_url":"https://api.github.com/repos/cockroachdb/cockroach","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/30727/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/30727/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/30727/events","html_url":"https://github.com/cockroachdb/cockroach/pull/30727","id":364580458,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE4NzMzMDEz","number":30727,"title":"cli: Make \"unknown sub-command\" error clearer for empty subcommands","user":{"login":"a-robinson","id":7085343,"node_id":"MDQ6VXNlcjcwODUzNDM=","avatar_url":"https://avatars3.githubusercontent.com/u/7085343?v=4","gravatar_id":"","url":"https://api.github.com/users/a-robinson","html_url":"https://github.com/a-robinson","followers_url":"https://api.github.com/users/a-robinson/followers","following_url":"https://api.github.com/users/a-robinson/following{/other_user}","gists_url":"https://api.github.com/users/a-robinson/gists{/gist_id}","starred_url":"https://api.github.com/users/a-robinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-robinson/subscriptions","organizations_url":"https://api.github.com/users/a-robinson/orgs","repos_url":"https://api.github.com/users/a-robinson/repos","events_url":"https://api.github.com/users/a-robinson/events{/privacy}","received_events_url":"https://api.github.com/users/a-robinson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-27T17:35:47Z","updated_at":"2018-09-27T17:43:59Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/30727","html_url":"https://github.com/cockroachdb/cockroach/pull/30727","diff_url":"https://github.com/cockroachdb/cockroach/pull/30727.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/30727.patch"},"body":"I ran `cockroach zone` to try and get the list of available sub-commands\r\nprinted as help text, but ended up getting confused by what it printed:\r\n\r\nError: unknown sub-command:\r\nFailed running \"zone\"\r\n\r\nI wasn't really sure what this meant. Now it'll print:\r\n\r\nError: unknown sub-command: \"\"\r\nFailed running \"zone\"\r\n\r\nIt may also be better to say something like \"unknown or missing\r\nsub-command\". Let me know if you'd prefer that.\r\n\r\nRelease note: None\r\n\r\n---\r\n\r\nAlong these lines, how come the available subcommands don't get printed anymore? I can't get them listed either with `cockroach zone` or `cockroach zone -h`. I could have sworn we used to list them. Did cobra change? Maybe I'm conflating cockroach with other tools. It'd certainly be nice if we did, though."},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/425181647","html_url":"https://github.com/cockroachdb/cockroach/pull/30727#issuecomment-425181647","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/30727","id":425181647,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTE4MTY0Nw==","user":{"login":"a-robinson","id":7085343,"node_id":"MDQ6VXNlcjcwODUzNDM=","avatar_url":"https://avatars3.githubusercontent.com/u/7085343?v=4","gravatar_id":"","url":"https://api.github.com/users/a-robinson","html_url":"https://github.com/a-robinson","followers_url":"https://api.github.com/users/a-robinson/followers","following_url":"https://api.github.com/users/a-robinson/following{/other_user}","gists_url":"https://api.github.com/users/a-robinson/gists{/gist_id}","starred_url":"https://api.github.com/users/a-robinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-robinson/subscriptions","organizations_url":"https://api.github.com/users/a-robinson/orgs","repos_url":"https://api.github.com/users/a-robinson/repos","events_url":"https://api.github.com/users/a-robinson/events{/privacy}","received_events_url":"https://api.github.com/users/a-robinson/received_events","type":"User","site_admin":false},"created_at":"2018-09-27T17:43:59Z","updated_at":"2018-09-27T17:43:59Z","author_association":"MEMBER","body":"Thanks for the quick review. Also, I double checked, and not printing the subcommands is a regression since 2.0. I'll open a separate issue, but do you have any available time to look into it?\r\n\r\n```\r\n~ 0 $ Downloads/cockroach-v2.0.3.darwin-10.9-amd64/cockroach zone\r\nUsage:\r\n  cockroach zone [flags]\r\n  cockroach zone [command]\r\n\r\nAvailable Commands:\r\n  get         fetches and displays the zone config\r\n  ls          list all zone configs\r\n  rm          remove a zone config\r\n  set         create or update zone config for object ID\r\n\r\nFlags:\r\n  -h, --help   help for zone\r\n\r\nGlobal Flags:\r\n      --log-backtrace-at traceLocation   when logging hits line file:N, emit a stack trace (default :0)\r\n      --log-dir string                   if non-empty, write log files in this directory\r\n      --log-dir-max-size bytes           maximum combined size of all log files (default 100 MiB)\r\n      --log-file-max-size bytes          maximum size of each log file (default 10 MiB)\r\n      --log-file-verbosity Severity      minimum verbosity of messages written to the log file (default INFO)\r\n      --logtostderr Severity[=DEFAULT]   logs at or above this threshold go to stderr (default NONE)\r\n      --no-color                         disable standard error log colorization\r\n      --verbosity level                  log level for V logs\r\n      --vmodule moduleSpec               comma-separated list of pattern=N settings for file-filtered logging\r\n\r\nUse \"cockroach zone [command] --help\" for more information about a command.\r\n~ 0 $ Downloads/cockroach-v2.1.0-beta.20180924.darwin-10.9-amd64/cockroach zone\r\nUsage:\r\n  cockroach zone [flags]\r\n\r\nFlags:\r\n  -h, --help   help for zone\r\n\r\nGlobal Flags:\r\n      --log-dir string                   if non-empty, write log files in this directory\r\n      --log-dir-max-size bytes           maximum combined size of all log files (default 100 MiB)\r\n      --log-file-max-size bytes          maximum size of each log file (default 10 MiB)\r\n      --log-file-verbosity Severity      minimum verbosity of messages written to the log file (default INFO)\r\n      --logtostderr Severity[=DEFAULT]   logs at or above this threshold go to stderr (default NONE)\r\n      --no-color                         disable standard error log colorization\r\n      --vmodule moduleSpec               comma-separated list of pattern=N settings for file-filtered logging (significantly hurts performance)\r\nError: unknown sub-command:\r\nFailed running \"zone\"\r\n~ 1 $\r\n```"}}
{"actor":{"display_login":"a-robinson"}}