{"action":"closed","number":1139,"pull_request":{"url":"https://api.github.com/repos/ipfs/go-ipfs/pulls/1139","id":34113429,"html_url":"https://github.com/ipfs/go-ipfs/pull/1139","diff_url":"https://github.com/ipfs/go-ipfs/pull/1139.diff","patch_url":"https://github.com/ipfs/go-ipfs/pull/1139.patch","issue_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/1139","number":1139,"state":"closed","locked":false,"title":"Improve command line parsing","user":{"login":"AtnNn","id":706854,"avatar_url":"https://avatars.githubusercontent.com/u/706854?v=3","gravatar_id":"","url":"https://api.github.com/users/AtnNn","html_url":"https://github.com/AtnNn","followers_url":"https://api.github.com/users/AtnNn/followers","following_url":"https://api.github.com/users/AtnNn/following{/other_user}","gists_url":"https://api.github.com/users/AtnNn/gists{/gist_id}","starred_url":"https://api.github.com/users/AtnNn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AtnNn/subscriptions","organizations_url":"https://api.github.com/users/AtnNn/orgs","repos_url":"https://api.github.com/users/AtnNn/repos","events_url":"https://api.github.com/users/AtnNn/events{/privacy}","received_events_url":"https://api.github.com/users/AtnNn/received_events","type":"User","site_admin":false},"body":"Fixes #1078 \r\n\r\nI used the syntax I would usually expect from a unix command. This is a breaking change, but some of this breakage could be avoided with more code.\r\n\r\n- short flags no longer use `=`. `-a=1` is now `-a 1` or `-a1`\r\n- sub-command specific flags cannot apear before the sub-command, such as `--bar foo` instead of `foo --bar`\r\n- `ipfs help` no longer works, it was only a by-product of errors being ignored. `ipfs` or `ipfs -h` can be used instead.\r\n\r\nHere are some trimmed examples:\r\n\r\n```\r\n$ ipfs pin ls --help\r\n    -t, --type  string - The type of pinned keys to list. Can be \"direct\", \"indirect\", \"recursive\", or \"all\". Defaults to \"direct\"\r\n    -n, --count bool   - Show refcount when listing indirect pins\r\n$ ipfs pin ls -t\r\nError: Missing argument for option 't'\r\n$ ipfs pin ls -t foo\r\nError: Invalid type 'foo', must be one of {direct, indirect, recursive, all}\r\n$ ipfs pin ls -t direct\r\n$ ipfs pin ls -tdirect\r\n$ ipfs pin ls -t=direct\r\nError: Invalid type '=direct', must be one of {direct, indirect, recursive, all}\r\n$ ipfs pin ls -n\r\n$ ipfs pin ls -nt direct\r\n$ ipfs pin ls -tn\r\nError: Invalid type 'n', must be one of {direct, indirect, recursive, all}\r\n$ ipfs pin ls --count foo\r\nError: Expected 0 arguments, got 1: [foo]\r\n$ ipfs pin ls --count=foo\r\nError: Option 'count' takes no arguments, but was passed 'foo'\r\n$ ipfs pin ls --type\r\nError: Missing argument for option 'type'\r\n$ ipfs pin ls --type=direct\r\n$ ipfs pin ls --type direct\r\n$ ipfs --count pin ls\r\nError: Unrecognized option 'count'\r\n$ ipfs --local pin ls\r\n```","created_at":"2015-04-25T21:27:35Z","updated_at":"2015-04-27T23:21:39Z","closed_at":"2015-04-27T23:21:39Z","merged_at":"2015-04-27T23:21:39Z","merge_commit_sha":"59e752fffa4a8d05c8c1b4313e657a95c9da8846","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ipfs/go-ipfs/pulls/1139/commits","review_comments_url":"https://api.github.com/repos/ipfs/go-ipfs/pulls/1139/comments","review_comment_url":"https://api.github.com/repos/ipfs/go-ipfs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/1139/comments","statuses_url":"https://api.github.com/repos/ipfs/go-ipfs/statuses/f168539030ac37f6b4131101a5a019790fd752d5","head":{"label":"AtnNn:flags","ref":"flags","sha":"f168539030ac37f6b4131101a5a019790fd752d5","user":{"login":"AtnNn","id":706854,"avatar_url":"https://avatars.githubusercontent.com/u/706854?v=3","gravatar_id":"","url":"https://api.github.com/users/AtnNn","html_url":"https://github.com/AtnNn","followers_url":"https://api.github.com/users/AtnNn/followers","following_url":"https://api.github.com/users/AtnNn/following{/other_user}","gists_url":"https://api.github.com/users/AtnNn/gists{/gist_id}","starred_url":"https://api.github.com/users/AtnNn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AtnNn/subscriptions","organizations_url":"https://api.github.com/users/AtnNn/orgs","repos_url":"https://api.github.com/users/AtnNn/repos","events_url":"https://api.github.com/users/AtnNn/events{/privacy}","received_events_url":"https://api.github.com/users/AtnNn/received_events","type":"User","site_admin":false},"repo":{"id":33419922,"name":"go-ipfs","full_name":"AtnNn/go-ipfs","owner":{"login":"AtnNn","id":706854,"avatar_url":"https://avatars.githubusercontent.com/u/706854?v=3","gravatar_id":"","url":"https://api.github.com/users/AtnNn","html_url":"https://github.com/AtnNn","followers_url":"https://api.github.com/users/AtnNn/followers","following_url":"https://api.github.com/users/AtnNn/following{/other_user}","gists_url":"https://api.github.com/users/AtnNn/gists{/gist_id}","starred_url":"https://api.github.com/users/AtnNn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AtnNn/subscriptions","organizations_url":"https://api.github.com/users/AtnNn/orgs","repos_url":"https://api.github.com/users/AtnNn/repos","events_url":"https://api.github.com/users/AtnNn/events{/privacy}","received_events_url":"https://api.github.com/users/AtnNn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AtnNn/go-ipfs","description":"ipfs implementation in go","fork":true,"url":"https://api.github.com/repos/AtnNn/go-ipfs","forks_url":"https://api.github.com/repos/AtnNn/go-ipfs/forks","keys_url":"https://api.github.com/repos/AtnNn/go-ipfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AtnNn/go-ipfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AtnNn/go-ipfs/teams","hooks_url":"https://api.github.com/repos/AtnNn/go-ipfs/hooks","issue_events_url":"https://api.github.com/repos/AtnNn/go-ipfs/issues/events{/number}","events_url":"https://api.github.com/repos/AtnNn/go-ipfs/events","assignees_url":"https://api.github.com/repos/AtnNn/go-ipfs/assignees{/user}","branches_url":"https://api.github.com/repos/AtnNn/go-ipfs/branches{/branch}","tags_url":"https://api.github.com/repos/AtnNn/go-ipfs/tags","blobs_url":"https://api.github.com/repos/AtnNn/go-ipfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AtnNn/go-ipfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AtnNn/go-ipfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/AtnNn/go-ipfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AtnNn/go-ipfs/statuses/{sha}","languages_url":"https://api.github.com/repos/AtnNn/go-ipfs/languages","stargazers_url":"https://api.github.com/repos/AtnNn/go-ipfs/stargazers","contributors_url":"https://api.github.com/repos/AtnNn/go-ipfs/contributors","subscribers_url":"https://api.github.com/repos/AtnNn/go-ipfs/subscribers","subscription_url":"https://api.github.com/repos/AtnNn/go-ipfs/subscription","commits_url":"https://api.github.com/repos/AtnNn/go-ipfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/AtnNn/go-ipfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/AtnNn/go-ipfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/AtnNn/go-ipfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/AtnNn/go-ipfs/contents/{+path}","compare_url":"https://api.github.com/repos/AtnNn/go-ipfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AtnNn/go-ipfs/merges","archive_url":"https://api.github.com/repos/AtnNn/go-ipfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AtnNn/go-ipfs/downloads","issues_url":"https://api.github.com/repos/AtnNn/go-ipfs/issues{/number}","pulls_url":"https://api.github.com/repos/AtnNn/go-ipfs/pulls{/number}","milestones_url":"https://api.github.com/repos/AtnNn/go-ipfs/milestones{/number}","notifications_url":"https://api.github.com/repos/AtnNn/go-ipfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AtnNn/go-ipfs/labels{/name}","releases_url":"https://api.github.com/repos/AtnNn/go-ipfs/releases{/id}","created_at":"2015-04-04T20:49:49Z","updated_at":"2015-04-04T20:49:50Z","pushed_at":"2015-04-27T17:31:00Z","git_url":"git://github.com/AtnNn/go-ipfs.git","ssh_url":"git@github.com:AtnNn/go-ipfs.git","clone_url":"https://github.com/AtnNn/go-ipfs.git","svn_url":"https://github.com/AtnNn/go-ipfs","homepage":"https://github.com/jbenet/ipfs","size":16749,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ipfs:master","ref":"master","sha":"196c6aa4a6c223b892789b310d161a12cbb62cdd","user":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars.githubusercontent.com/u/10536621?v=3","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"repo":{"id":21233191,"name":"go-ipfs","full_name":"ipfs/go-ipfs","owner":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars.githubusercontent.com/u/10536621?v=3","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ipfs/go-ipfs","description":"ipfs implementation in go","fork":false,"url":"https://api.github.com/repos/ipfs/go-ipfs","forks_url":"https://api.github.com/repos/ipfs/go-ipfs/forks","keys_url":"https://api.github.com/repos/ipfs/go-ipfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipfs/go-ipfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipfs/go-ipfs/teams","hooks_url":"https://api.github.com/repos/ipfs/go-ipfs/hooks","issue_events_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/events{/number}","events_url":"https://api.github.com/repos/ipfs/go-ipfs/events","assignees_url":"https://api.github.com/repos/ipfs/go-ipfs/assignees{/user}","branches_url":"https://api.github.com/repos/ipfs/go-ipfs/branches{/branch}","tags_url":"https://api.github.com/repos/ipfs/go-ipfs/tags","blobs_url":"https://api.github.com/repos/ipfs/go-ipfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipfs/go-ipfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipfs/go-ipfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipfs/go-ipfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipfs/go-ipfs/statuses/{sha}","languages_url":"https://api.github.com/repos/ipfs/go-ipfs/languages","stargazers_url":"https://api.github.com/repos/ipfs/go-ipfs/stargazers","contributors_url":"https://api.github.com/repos/ipfs/go-ipfs/contributors","subscribers_url":"https://api.github.com/repos/ipfs/go-ipfs/subscribers","subscription_url":"https://api.github.com/repos/ipfs/go-ipfs/subscription","commits_url":"https://api.github.com/repos/ipfs/go-ipfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipfs/go-ipfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipfs/go-ipfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipfs/go-ipfs/contents/{+path}","compare_url":"https://api.github.com/repos/ipfs/go-ipfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipfs/go-ipfs/merges","archive_url":"https://api.github.com/repos/ipfs/go-ipfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipfs/go-ipfs/downloads","issues_url":"https://api.github.com/repos/ipfs/go-ipfs/issues{/number}","pulls_url":"https://api.github.com/repos/ipfs/go-ipfs/pulls{/number}","milestones_url":"https://api.github.com/repos/ipfs/go-ipfs/milestones{/number}","notifications_url":"https://api.github.com/repos/ipfs/go-ipfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipfs/go-ipfs/labels{/name}","releases_url":"https://api.github.com/repos/ipfs/go-ipfs/releases{/id}","created_at":"2014-06-26T08:14:34Z","updated_at":"2015-04-27T21:51:43Z","pushed_at":"2015-04-27T23:21:39Z","git_url":"git://github.com/ipfs/go-ipfs.git","ssh_url":"git@github.com:ipfs/go-ipfs.git","clone_url":"https://github.com/ipfs/go-ipfs.git","svn_url":"https://github.com/ipfs/go-ipfs","homepage":"https://github.com/ipfs/ipfs","size":34558,"stargazers_count":510,"watchers_count":510,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":81,"mirror_url":null,"open_issues_count":217,"forks":81,"open_issues":217,"watchers":510,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ipfs/go-ipfs/pulls/1139"},"html":{"href":"https://github.com/ipfs/go-ipfs/pull/1139"},"issue":{"href":"https://api.github.com/repos/ipfs/go-ipfs/issues/1139"},"comments":{"href":"https://api.github.com/repos/ipfs/go-ipfs/issues/1139/comments"},"review_comments":{"href":"https://api.github.com/repos/ipfs/go-ipfs/pulls/1139/comments"},"review_comment":{"href":"https://api.github.com/repos/ipfs/go-ipfs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ipfs/go-ipfs/pulls/1139/commits"},"statuses":{"href":"https://api.github.com/repos/ipfs/go-ipfs/statuses/f168539030ac37f6b4131101a5a019790fd752d5"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"jbenet","id":138401,"avatar_url":"https://avatars.githubusercontent.com/u/138401?v=3","gravatar_id":"","url":"https://api.github.com/users/jbenet","html_url":"https://github.com/jbenet","followers_url":"https://api.github.com/users/jbenet/followers","following_url":"https://api.github.com/users/jbenet/following{/other_user}","gists_url":"https://api.github.com/users/jbenet/gists{/gist_id}","starred_url":"https://api.github.com/users/jbenet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbenet/subscriptions","organizations_url":"https://api.github.com/users/jbenet/orgs","repos_url":"https://api.github.com/users/jbenet/repos","events_url":"https://api.github.com/users/jbenet/events{/privacy}","received_events_url":"https://api.github.com/users/jbenet/received_events","type":"User","site_admin":false},"comments":10,"review_comments":14,"commits":1,"additions":230,"deletions":120,"changed_files":10}}