{"action":"created","comment":{"url":"https://api.github.com/repos/spf13/cobra/pulls/comments/32966933","id":32966933,"diff_hunk":"@@ -343,8 +347,14 @@ func (cmd *Command) GenBashCompletionFile(filename string) error {\n \treturn nil\n }\n \n+// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag, if it exists.\n func (cmd *Command) MarkFlagRequired(name string) {\n-\tflag := cmd.Flags().Lookup(name)\n+\tMarkFlagRequired(cmd.Flags(), name)\n+}\n+\n+// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag in the flag set, if it exists.\n+func MarkFlagRequired(flags *pflag.FlagSet, name string) {","path":"bash_completions.go","position":28,"original_position":28,"commit_id":"f3d7eaa4df1a2dc58ff0a4d906815d2a593f0cf1","original_commit_id":"f3d7eaa4df1a2dc58ff0a4d906815d2a593f0cf1","user":{"login":"liggitt","id":980082,"avatar_url":"https://avatars.githubusercontent.com/u/980082?v=3","gravatar_id":"","url":"https://api.github.com/users/liggitt","html_url":"https://github.com/liggitt","followers_url":"https://api.github.com/users/liggitt/followers","following_url":"https://api.github.com/users/liggitt/following{/other_user}","gists_url":"https://api.github.com/users/liggitt/gists{/gist_id}","starred_url":"https://api.github.com/users/liggitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liggitt/subscriptions","organizations_url":"https://api.github.com/users/liggitt/orgs","repos_url":"https://api.github.com/users/liggitt/repos","events_url":"https://api.github.com/users/liggitt/events{/privacy}","received_events_url":"https://api.github.com/users/liggitt/received_events","type":"User","site_admin":false},"body":"allows setting the annotation if all you have is a flagset","created_at":"2015-06-22T18:28:47Z","updated_at":"2015-06-22T18:28:47Z","html_url":"https://github.com/spf13/cobra/pull/118#discussion_r32966933","pull_request_url":"https://api.github.com/repos/spf13/cobra/pulls/118","_links":{"self":{"href":"https://api.github.com/repos/spf13/cobra/pulls/comments/32966933"},"html":{"href":"https://github.com/spf13/cobra/pull/118#discussion_r32966933"},"pull_request":{"href":"https://api.github.com/repos/spf13/cobra/pulls/118"}}},"pull_request":{"url":"https://api.github.com/repos/spf13/cobra/pulls/118","id":38261229,"html_url":"https://github.com/spf13/cobra/pull/118","diff_url":"https://github.com/spf13/cobra/pull/118.diff","patch_url":"https://github.com/spf13/cobra/pull/118.patch","issue_url":"https://api.github.com/repos/spf13/cobra/issues/118","number":118,"state":"open","locked":false,"title":"Simplify setting file/extension annotations on a flag","user":{"login":"liggitt","id":980082,"avatar_url":"https://avatars.githubusercontent.com/u/980082?v=3","gravatar_id":"","url":"https://api.github.com/users/liggitt","html_url":"https://github.com/liggitt","followers_url":"https://api.github.com/users/liggitt/followers","following_url":"https://api.github.com/users/liggitt/following{/other_user}","gists_url":"https://api.github.com/users/liggitt/gists{/gist_id}","starred_url":"https://api.github.com/users/liggitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liggitt/subscriptions","organizations_url":"https://api.github.com/users/liggitt/orgs","repos_url":"https://api.github.com/users/liggitt/repos","events_url":"https://api.github.com/users/liggitt/events{/privacy}","received_events_url":"https://api.github.com/users/liggitt/received_events","type":"User","site_admin":false},"body":null,"created_at":"2015-06-22T18:28:21Z","updated_at":"2015-06-22T18:28:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bf972ee2165afcaf636266c7102aa08cd369d40a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/spf13/cobra/pulls/118/commits","review_comments_url":"https://api.github.com/repos/spf13/cobra/pulls/118/comments","review_comment_url":"https://api.github.com/repos/spf13/cobra/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spf13/cobra/issues/118/comments","statuses_url":"https://api.github.com/repos/spf13/cobra/statuses/f3d7eaa4df1a2dc58ff0a4d906815d2a593f0cf1","head":{"label":"liggitt:file_autocomplete_helper","ref":"file_autocomplete_helper","sha":"f3d7eaa4df1a2dc58ff0a4d906815d2a593f0cf1","user":{"login":"liggitt","id":980082,"avatar_url":"https://avatars.githubusercontent.com/u/980082?v=3","gravatar_id":"","url":"https://api.github.com/users/liggitt","html_url":"https://github.com/liggitt","followers_url":"https://api.github.com/users/liggitt/followers","following_url":"https://api.github.com/users/liggitt/following{/other_user}","gists_url":"https://api.github.com/users/liggitt/gists{/gist_id}","starred_url":"https://api.github.com/users/liggitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liggitt/subscriptions","organizations_url":"https://api.github.com/users/liggitt/orgs","repos_url":"https://api.github.com/users/liggitt/repos","events_url":"https://api.github.com/users/liggitt/events{/privacy}","received_events_url":"https://api.github.com/users/liggitt/received_events","type":"User","site_admin":false},"repo":{"id":37863026,"name":"cobra","full_name":"liggitt/cobra","owner":{"login":"liggitt","id":980082,"avatar_url":"https://avatars.githubusercontent.com/u/980082?v=3","gravatar_id":"","url":"https://api.github.com/users/liggitt","html_url":"https://github.com/liggitt","followers_url":"https://api.github.com/users/liggitt/followers","following_url":"https://api.github.com/users/liggitt/following{/other_user}","gists_url":"https://api.github.com/users/liggitt/gists{/gist_id}","starred_url":"https://api.github.com/users/liggitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liggitt/subscriptions","organizations_url":"https://api.github.com/users/liggitt/orgs","repos_url":"https://api.github.com/users/liggitt/repos","events_url":"https://api.github.com/users/liggitt/events{/privacy}","received_events_url":"https://api.github.com/users/liggitt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/liggitt/cobra","description":"A Commander for modern Go CLI interactions","fork":true,"url":"https://api.github.com/repos/liggitt/cobra","forks_url":"https://api.github.com/repos/liggitt/cobra/forks","keys_url":"https://api.github.com/repos/liggitt/cobra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/liggitt/cobra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/liggitt/cobra/teams","hooks_url":"https://api.github.com/repos/liggitt/cobra/hooks","issue_events_url":"https://api.github.com/repos/liggitt/cobra/issues/events{/number}","events_url":"https://api.github.com/repos/liggitt/cobra/events","assignees_url":"https://api.github.com/repos/liggitt/cobra/assignees{/user}","branches_url":"https://api.github.com/repos/liggitt/cobra/branches{/branch}","tags_url":"https://api.github.com/repos/liggitt/cobra/tags","blobs_url":"https://api.github.com/repos/liggitt/cobra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/liggitt/cobra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/liggitt/cobra/git/refs{/sha}","trees_url":"https://api.github.com/repos/liggitt/cobra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/liggitt/cobra/statuses/{sha}","languages_url":"https://api.github.com/repos/liggitt/cobra/languages","stargazers_url":"https://api.github.com/repos/liggitt/cobra/stargazers","contributors_url":"https://api.github.com/repos/liggitt/cobra/contributors","subscribers_url":"https://api.github.com/repos/liggitt/cobra/subscribers","subscription_url":"https://api.github.com/repos/liggitt/cobra/subscription","commits_url":"https://api.github.com/repos/liggitt/cobra/commits{/sha}","git_commits_url":"https://api.github.com/repos/liggitt/cobra/git/commits{/sha}","comments_url":"https://api.github.com/repos/liggitt/cobra/comments{/number}","issue_comment_url":"https://api.github.com/repos/liggitt/cobra/issues/comments{/number}","contents_url":"https://api.github.com/repos/liggitt/cobra/contents/{+path}","compare_url":"https://api.github.com/repos/liggitt/cobra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/liggitt/cobra/merges","archive_url":"https://api.github.com/repos/liggitt/cobra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/liggitt/cobra/downloads","issues_url":"https://api.github.com/repos/liggitt/cobra/issues{/number}","pulls_url":"https://api.github.com/repos/liggitt/cobra/pulls{/number}","milestones_url":"https://api.github.com/repos/liggitt/cobra/milestones{/number}","notifications_url":"https://api.github.com/repos/liggitt/cobra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/liggitt/cobra/labels{/name}","releases_url":"https://api.github.com/repos/liggitt/cobra/releases{/id}","created_at":"2015-06-22T15:20:08Z","updated_at":"2015-06-22T15:20:08Z","pushed_at":"2015-06-22T18:28:18Z","git_url":"git://github.com/liggitt/cobra.git","ssh_url":"git@github.com:liggitt/cobra.git","clone_url":"https://github.com/liggitt/cobra.git","svn_url":"https://github.com/liggitt/cobra","homepage":"","size":955,"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":"spf13:master","ref":"master","sha":"312092086bed4968099259622145a0c9ae280064","user":{"login":"spf13","id":173412,"avatar_url":"https://avatars.githubusercontent.com/u/173412?v=3","gravatar_id":"","url":"https://api.github.com/users/spf13","html_url":"https://github.com/spf13","followers_url":"https://api.github.com/users/spf13/followers","following_url":"https://api.github.com/users/spf13/following{/other_user}","gists_url":"https://api.github.com/users/spf13/gists{/gist_id}","starred_url":"https://api.github.com/users/spf13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spf13/subscriptions","organizations_url":"https://api.github.com/users/spf13/orgs","repos_url":"https://api.github.com/users/spf13/repos","events_url":"https://api.github.com/users/spf13/events{/privacy}","received_events_url":"https://api.github.com/users/spf13/received_events","type":"User","site_admin":false},"repo":{"id":12574344,"name":"cobra","full_name":"spf13/cobra","owner":{"login":"spf13","id":173412,"avatar_url":"https://avatars.githubusercontent.com/u/173412?v=3","gravatar_id":"","url":"https://api.github.com/users/spf13","html_url":"https://github.com/spf13","followers_url":"https://api.github.com/users/spf13/followers","following_url":"https://api.github.com/users/spf13/following{/other_user}","gists_url":"https://api.github.com/users/spf13/gists{/gist_id}","starred_url":"https://api.github.com/users/spf13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spf13/subscriptions","organizations_url":"https://api.github.com/users/spf13/orgs","repos_url":"https://api.github.com/users/spf13/repos","events_url":"https://api.github.com/users/spf13/events{/privacy}","received_events_url":"https://api.github.com/users/spf13/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/spf13/cobra","description":"A Commander for modern Go CLI interactions","fork":false,"url":"https://api.github.com/repos/spf13/cobra","forks_url":"https://api.github.com/repos/spf13/cobra/forks","keys_url":"https://api.github.com/repos/spf13/cobra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spf13/cobra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spf13/cobra/teams","hooks_url":"https://api.github.com/repos/spf13/cobra/hooks","issue_events_url":"https://api.github.com/repos/spf13/cobra/issues/events{/number}","events_url":"https://api.github.com/repos/spf13/cobra/events","assignees_url":"https://api.github.com/repos/spf13/cobra/assignees{/user}","branches_url":"https://api.github.com/repos/spf13/cobra/branches{/branch}","tags_url":"https://api.github.com/repos/spf13/cobra/tags","blobs_url":"https://api.github.com/repos/spf13/cobra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spf13/cobra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spf13/cobra/git/refs{/sha}","trees_url":"https://api.github.com/repos/spf13/cobra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spf13/cobra/statuses/{sha}","languages_url":"https://api.github.com/repos/spf13/cobra/languages","stargazers_url":"https://api.github.com/repos/spf13/cobra/stargazers","contributors_url":"https://api.github.com/repos/spf13/cobra/contributors","subscribers_url":"https://api.github.com/repos/spf13/cobra/subscribers","subscription_url":"https://api.github.com/repos/spf13/cobra/subscription","commits_url":"https://api.github.com/repos/spf13/cobra/commits{/sha}","git_commits_url":"https://api.github.com/repos/spf13/cobra/git/commits{/sha}","comments_url":"https://api.github.com/repos/spf13/cobra/comments{/number}","issue_comment_url":"https://api.github.com/repos/spf13/cobra/issues/comments{/number}","contents_url":"https://api.github.com/repos/spf13/cobra/contents/{+path}","compare_url":"https://api.github.com/repos/spf13/cobra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spf13/cobra/merges","archive_url":"https://api.github.com/repos/spf13/cobra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spf13/cobra/downloads","issues_url":"https://api.github.com/repos/spf13/cobra/issues{/number}","pulls_url":"https://api.github.com/repos/spf13/cobra/pulls{/number}","milestones_url":"https://api.github.com/repos/spf13/cobra/milestones{/number}","notifications_url":"https://api.github.com/repos/spf13/cobra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spf13/cobra/labels{/name}","releases_url":"https://api.github.com/repos/spf13/cobra/releases{/id}","created_at":"2013-09-03T20:40:26Z","updated_at":"2015-06-22T12:26:10Z","pushed_at":"2015-06-22T18:28:21Z","git_url":"git://github.com/spf13/cobra.git","ssh_url":"git@github.com:spf13/cobra.git","clone_url":"https://github.com/spf13/cobra.git","svn_url":"https://github.com/spf13/cobra","homepage":"","size":955,"stargazers_count":951,"watchers_count":951,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":86,"mirror_url":null,"open_issues_count":21,"forks":86,"open_issues":21,"watchers":951,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spf13/cobra/pulls/118"},"html":{"href":"https://github.com/spf13/cobra/pull/118"},"issue":{"href":"https://api.github.com/repos/spf13/cobra/issues/118"},"comments":{"href":"https://api.github.com/repos/spf13/cobra/issues/118/comments"},"review_comments":{"href":"https://api.github.com/repos/spf13/cobra/pulls/118/comments"},"review_comment":{"href":"https://api.github.com/repos/spf13/cobra/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spf13/cobra/pulls/118/commits"},"statuses":{"href":"https://api.github.com/repos/spf13/cobra/statuses/f3d7eaa4df1a2dc58ff0a4d906815d2a593f0cf1"}}}}