{"action":"created","issue":{"url":"https://api.github.com/repos/spf13/cobra/issues/119","labels_url":"https://api.github.com/repos/spf13/cobra/issues/119/labels{/name}","comments_url":"https://api.github.com/repos/spf13/cobra/issues/119/comments","events_url":"https://api.github.com/repos/spf13/cobra/issues/119/events","html_url":"https://github.com/spf13/cobra/pull/119","id":90217304,"number":119,"title":"Correctly print the unknown command name","user":{"login":"eparis","id":8093535,"avatar_url":"https://avatars.githubusercontent.com/u/8093535?v=3","gravatar_id":"","url":"https://api.github.com/users/eparis","html_url":"https://github.com/eparis","followers_url":"https://api.github.com/users/eparis/followers","following_url":"https://api.github.com/users/eparis/following{/other_user}","gists_url":"https://api.github.com/users/eparis/gists{/gist_id}","starred_url":"https://api.github.com/users/eparis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eparis/subscriptions","organizations_url":"https://api.github.com/users/eparis/orgs","repos_url":"https://api.github.com/users/eparis/repos","events_url":"https://api.github.com/users/eparis/events{/privacy}","received_events_url":"https://api.github.com/users/eparis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-22T21:29:08Z","updated_at":"2015-06-22T21:52:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/spf13/cobra/pulls/119","html_url":"https://github.com/spf13/cobra/pull/119","diff_url":"https://github.com/spf13/cobra/pull/119.diff","patch_url":"https://github.com/spf13/cobra/pull/119.patch"},"body":"by now, if someone calls: program --validflag unknowncommand the\r\noutput will be:\r\n\r\n```\r\nError: unknown command \"--validflag\"\r\nRun 'program help' for usage.\r\n```\r\nThis patch strips out flags so the unknown command is printed:\r\n```\r\nError: unknown command \"unknowncommand\"\r\nRun 'program help' for usage.\r\n```\r\n\r\nReported-by: Simone Gotti in https://github.com/spf13/cobra/pull/116\r\n\r\nThis also fixes a problem with the original code where if you had a\r\nroot command and a grand child with the same name, the parser would\r\nbreak and would not run the grandchild. The code was special casing if\r\nthe immediate child had the same name, but didn't handle grand-children"},"comment":{"url":"https://api.github.com/repos/spf13/cobra/issues/comments/114275494","html_url":"https://github.com/spf13/cobra/pull/119#issuecomment-114275494","issue_url":"https://api.github.com/repos/spf13/cobra/issues/119","id":114275494,"user":{"login":"eparis","id":8093535,"avatar_url":"https://avatars.githubusercontent.com/u/8093535?v=3","gravatar_id":"","url":"https://api.github.com/users/eparis","html_url":"https://github.com/eparis","followers_url":"https://api.github.com/users/eparis/followers","following_url":"https://api.github.com/users/eparis/following{/other_user}","gists_url":"https://api.github.com/users/eparis/gists{/gist_id}","starred_url":"https://api.github.com/users/eparis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eparis/subscriptions","organizations_url":"https://api.github.com/users/eparis/orgs","repos_url":"https://api.github.com/users/eparis/repos","events_url":"https://api.github.com/users/eparis/events{/privacy}","received_events_url":"https://api.github.com/users/eparis/received_events","type":"User","site_admin":false},"created_at":"2015-06-22T21:52:39Z","updated_at":"2015-06-22T21:52:39Z","body":"@sgotti that's fair. I'll merge your patch and rebase mine on top. I'm going to push a new PR with a whole slew of changes you might want to check out. Really cleans up a bunch."}}