{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/29403036","id":29403036,"diff_hunk":"@@ -24,11 +24,113 @@ const (\n \tdefaultCertFile     = \"cert.pem\"\n )\n \n+func checkDaemon(args []string) bool {\n+\tfor j := 1; j < len(args); j++ {\n+\t\tif args[j] == \"-d\" || args[j] == \"--daemon\" {\n+\t\t\treturn true\n+\t\t} else if args[j][:1] == \"-\" {\n+\t\t\tif index_of_equal := strings.Index(args[j], \"=\"); index_of_equal != -1 {\n+\t\t\t\tcontinue //Flag with a value\n+\t\t\t} else {\n+\t\t\t\tisBool, exists := flag.CommandLine.FlagsMap[args[j]]\n+\t\t\t\tif exists && !isBool {\n+\t\t\t\t\t//Global string flag\n+\t\t\t\t\tj = j + 1\n+\t\t\t\t\tcontinue\n+\t\t\t\t} else if exists && isBool {\n+\t\t\t\t\t//Global bool flag\n+\t\t\t\t\tcontinue\n+\t\t\t\t}\n+\n+\t\t\t\tisBool, exists = cmd.FlagsMap[args[j]]\n+\t\t\t\tif exists && !isBool {\n+\t\t\t\t\t//Daemon string flag\n+\t\t\t\t\tj = j + 1\n+\t\t\t\t\tcontinue\n+\t\t\t\t} else if exists && isBool {\n+\t\t\t\t\t//Daemon bool flag\n+\t\t\t\t\tcontinue\n+\t\t\t\t}\n+\t\t\t\tbreak\n+\t\t\t}\n+\t\t} else {\n+\t\t\tbreak\n+\t\t}\n+\t}\n+\treturn false\n+}\n+\n+func shuffle(args []string) []string {\n+\tvar (\n+\t\tglobal_args = []string{args[0]}\n+\t\trest_args   = []string{\"daemon\"}\n+\t)\n+\n+\tlogrus.Printf(\"-d and --daemon are deprecated. Please use daemon command\")\n+\t//Shuffling of arguments required.Create global and rest args list.\n+\n+\tfor j := 1; j < len(args); j++ {\n+\t\tif args[j] == \"-d\" || args[j] == \"--daemon\" {\n+\t\t\tcontinue\n+\t\t}\n+\t\tif args[j][:1] == \"-\" {\n+\t\t\tif index_of_equal := strings.Index(args[j], \"=\"); index_of_equal != -1 {\n+\t\t\t\t_, exists := flag.CommandLine.FlagsMap[args[j][:index_of_equal]]\n+\t\t\t\tif exists {\n+\t\t\t\t\t//Global flag with a value\n+\t\t\t\t\tglobal_args = append(global_args, args[j])\n+\t\t\t\t\tcontinue\n+\t\t\t\t}\n+\t\t\t\trest_args = append(rest_args, args[j])\n+\t\t\t\tcontinue\n+\t\t\t}\n+\t\t\tisBool, exists := flag.CommandLine.FlagsMap[args[j]]\n+\t\t\tif exists && !isBool {\n+\t\t\t\t//Global string flag\n+\t\t\t\tglobal_args = append(global_args, args[j])\n+\t\t\t\tj = j + 1\n+\t\t\t\tglobal_args = append(global_args, args[j])\n+\t\t\t\tcontinue\n+\t\t\t} else if exists && isBool {\n+\t\t\t\t//Global bool flag\n+\t\t\t\tglobal_args = append(global_args, args[j])\n+\t\t\t\tcontinue\n+\t\t\t}\n+\n+\t\t\tisBool, exists = cmd.FlagsMap[args[j]]\n+\t\t\tif exists && !isBool {\n+\t\t\t\t//Daemon string flag\n+\t\t\t\trest_args = append(rest_args, args[j])\n+\t\t\t\tj = j + 1\n+\t\t\t\trest_args = append(rest_args, args[j])\n+\t\t\t\tcontinue\n+\t\t\t} else if exists && isBool {\n+\t\t\t\t//Daemon bool flag\n+\t\t\t\trest_args = append(rest_args, args[j])\n+\t\t\t\tcontinue\n+\t\t\t}","path":"docker/docker.go","position":null,"original_position":88,"commit_id":"f9dde17bb413bd0f185ffe11f4a6084d08d16542","original_commit_id":"d6d3674ebbdbe22412456f748cb21bd1c3363f22","user":{"login":"shishir-a412ed","id":4207652,"avatar_url":"https://avatars.githubusercontent.com/u/4207652?v=3","gravatar_id":"","url":"https://api.github.com/users/shishir-a412ed","html_url":"https://github.com/shishir-a412ed","followers_url":"https://api.github.com/users/shishir-a412ed/followers","following_url":"https://api.github.com/users/shishir-a412ed/following{/other_user}","gists_url":"https://api.github.com/users/shishir-a412ed/gists{/gist_id}","starred_url":"https://api.github.com/users/shishir-a412ed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shishir-a412ed/subscriptions","organizations_url":"https://api.github.com/users/shishir-a412ed/orgs","repos_url":"https://api.github.com/users/shishir-a412ed/repos","events_url":"https://api.github.com/users/shishir-a412ed/events{/privacy}","received_events_url":"https://api.github.com/users/shishir-a412ed/received_events","type":"User","site_admin":false},"body":"Fixed.","created_at":"2015-04-30T04:25:10Z","updated_at":"2015-04-30T04:25:10Z","html_url":"https://github.com/docker/docker/pull/10535#discussion_r29403036","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/10535","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/29403036"},"html":{"href":"https://github.com/docker/docker/pull/10535#discussion_r29403036"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/10535"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/10535","id":28567123,"html_url":"https://github.com/docker/docker/pull/10535","diff_url":"https://github.com/docker/docker/pull/10535.diff","patch_url":"https://github.com/docker/docker/pull/10535.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/10535","number":10535,"state":"open","locked":false,"title":"Replacing -d/--daemon with daemon command. Implementation of 'docker daemon' command","user":{"login":"shishir-a412ed","id":4207652,"avatar_url":"https://avatars.githubusercontent.com/u/4207652?v=3","gravatar_id":"","url":"https://api.github.com/users/shishir-a412ed","html_url":"https://github.com/shishir-a412ed","followers_url":"https://api.github.com/users/shishir-a412ed/followers","following_url":"https://api.github.com/users/shishir-a412ed/following{/other_user}","gists_url":"https://api.github.com/users/shishir-a412ed/gists{/gist_id}","starred_url":"https://api.github.com/users/shishir-a412ed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shishir-a412ed/subscriptions","organizations_url":"https://api.github.com/users/shishir-a412ed/orgs","repos_url":"https://api.github.com/users/shishir-a412ed/repos","events_url":"https://api.github.com/users/shishir-a412ed/events{/privacy}","received_events_url":"https://api.github.com/users/shishir-a412ed/received_events","type":"User","site_admin":false},"body":"Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com","created_at":"2015-02-03T16:36:20Z","updated_at":"2015-04-30T04:25:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b9ecc638c55d4b648a17433af73e0065fefd30a9","assignee":{"login":"tiborvass","id":827131,"avatar_url":"https://avatars.githubusercontent.com/u/827131?v=3","gravatar_id":"","url":"https://api.github.com/users/tiborvass","html_url":"https://github.com/tiborvass","followers_url":"https://api.github.com/users/tiborvass/followers","following_url":"https://api.github.com/users/tiborvass/following{/other_user}","gists_url":"https://api.github.com/users/tiborvass/gists{/gist_id}","starred_url":"https://api.github.com/users/tiborvass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiborvass/subscriptions","organizations_url":"https://api.github.com/users/tiborvass/orgs","repos_url":"https://api.github.com/users/tiborvass/repos","events_url":"https://api.github.com/users/tiborvass/events{/privacy}","received_events_url":"https://api.github.com/users/tiborvass/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/docker/docker/milestones/38","html_url":"https://github.com/docker/docker/milestones/1.7.0","labels_url":"https://api.github.com/repos/docker/docker/milestones/38/labels","id":1010239,"number":38,"title":"1.7.0","description":"","creator":{"login":"dmcgowan","id":169601,"avatar_url":"https://avatars.githubusercontent.com/u/169601?v=3","gravatar_id":"","url":"https://api.github.com/users/dmcgowan","html_url":"https://github.com/dmcgowan","followers_url":"https://api.github.com/users/dmcgowan/followers","following_url":"https://api.github.com/users/dmcgowan/following{/other_user}","gists_url":"https://api.github.com/users/dmcgowan/gists{/gist_id}","starred_url":"https://api.github.com/users/dmcgowan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmcgowan/subscriptions","organizations_url":"https://api.github.com/users/dmcgowan/orgs","repos_url":"https://api.github.com/users/dmcgowan/repos","events_url":"https://api.github.com/users/dmcgowan/events{/privacy}","received_events_url":"https://api.github.com/users/dmcgowan/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":10,"state":"open","created_at":"2015-03-07T01:54:49Z","updated_at":"2015-04-28T01:20:55Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/docker/docker/pulls/10535/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/10535/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/10535/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/f9dde17bb413bd0f185ffe11f4a6084d08d16542","head":{"label":"shishir-a412ed:docker_daemon_cmd","ref":"docker_daemon_cmd","sha":"f9dde17bb413bd0f185ffe11f4a6084d08d16542","user":{"login":"shishir-a412ed","id":4207652,"avatar_url":"https://avatars.githubusercontent.com/u/4207652?v=3","gravatar_id":"","url":"https://api.github.com/users/shishir-a412ed","html_url":"https://github.com/shishir-a412ed","followers_url":"https://api.github.com/users/shishir-a412ed/followers","following_url":"https://api.github.com/users/shishir-a412ed/following{/other_user}","gists_url":"https://api.github.com/users/shishir-a412ed/gists{/gist_id}","starred_url":"https://api.github.com/users/shishir-a412ed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shishir-a412ed/subscriptions","organizations_url":"https://api.github.com/users/shishir-a412ed/orgs","repos_url":"https://api.github.com/users/shishir-a412ed/repos","events_url":"https://api.github.com/users/shishir-a412ed/events{/privacy}","received_events_url":"https://api.github.com/users/shishir-a412ed/received_events","type":"User","site_admin":false},"repo":{"id":26453840,"name":"docker","full_name":"shishir-a412ed/docker","owner":{"login":"shishir-a412ed","id":4207652,"avatar_url":"https://avatars.githubusercontent.com/u/4207652?v=3","gravatar_id":"","url":"https://api.github.com/users/shishir-a412ed","html_url":"https://github.com/shishir-a412ed","followers_url":"https://api.github.com/users/shishir-a412ed/followers","following_url":"https://api.github.com/users/shishir-a412ed/following{/other_user}","gists_url":"https://api.github.com/users/shishir-a412ed/gists{/gist_id}","starred_url":"https://api.github.com/users/shishir-a412ed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shishir-a412ed/subscriptions","organizations_url":"https://api.github.com/users/shishir-a412ed/orgs","repos_url":"https://api.github.com/users/shishir-a412ed/repos","events_url":"https://api.github.com/users/shishir-a412ed/events{/privacy}","received_events_url":"https://api.github.com/users/shishir-a412ed/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shishir-a412ed/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/shishir-a412ed/docker","forks_url":"https://api.github.com/repos/shishir-a412ed/docker/forks","keys_url":"https://api.github.com/repos/shishir-a412ed/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shishir-a412ed/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shishir-a412ed/docker/teams","hooks_url":"https://api.github.com/repos/shishir-a412ed/docker/hooks","issue_events_url":"https://api.github.com/repos/shishir-a412ed/docker/issues/events{/number}","events_url":"https://api.github.com/repos/shishir-a412ed/docker/events","assignees_url":"https://api.github.com/repos/shishir-a412ed/docker/assignees{/user}","branches_url":"https://api.github.com/repos/shishir-a412ed/docker/branches{/branch}","tags_url":"https://api.github.com/repos/shishir-a412ed/docker/tags","blobs_url":"https://api.github.com/repos/shishir-a412ed/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shishir-a412ed/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shishir-a412ed/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/shishir-a412ed/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shishir-a412ed/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/shishir-a412ed/docker/languages","stargazers_url":"https://api.github.com/repos/shishir-a412ed/docker/stargazers","contributors_url":"https://api.github.com/repos/shishir-a412ed/docker/contributors","subscribers_url":"https://api.github.com/repos/shishir-a412ed/docker/subscribers","subscription_url":"https://api.github.com/repos/shishir-a412ed/docker/subscription","commits_url":"https://api.github.com/repos/shishir-a412ed/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/shishir-a412ed/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/shishir-a412ed/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/shishir-a412ed/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/shishir-a412ed/docker/contents/{+path}","compare_url":"https://api.github.com/repos/shishir-a412ed/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shishir-a412ed/docker/merges","archive_url":"https://api.github.com/repos/shishir-a412ed/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shishir-a412ed/docker/downloads","issues_url":"https://api.github.com/repos/shishir-a412ed/docker/issues{/number}","pulls_url":"https://api.github.com/repos/shishir-a412ed/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/shishir-a412ed/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/shishir-a412ed/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shishir-a412ed/docker/labels{/name}","releases_url":"https://api.github.com/repos/shishir-a412ed/docker/releases{/id}","created_at":"2014-11-10T20:18:33Z","updated_at":"2015-04-30T04:16:24Z","pushed_at":"2015-04-30T04:24:42Z","git_url":"git://github.com/shishir-a412ed/docker.git","ssh_url":"git@github.com:shishir-a412ed/docker.git","clone_url":"https://github.com/shishir-a412ed/docker.git","svn_url":"https://github.com/shishir-a412ed/docker","homepage":"http://www.docker.com","size":52709,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"docker:master","ref":"master","sha":"029cbc10040ab9ee336663889454e5b08d1ef785","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":7691631,"name":"docker","full_name":"docker/docker","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/docker","description":"Docker - the open-source application container engine","fork":false,"url":"https://api.github.com/repos/docker/docker","forks_url":"https://api.github.com/repos/docker/docker/forks","keys_url":"https://api.github.com/repos/docker/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/docker/teams","hooks_url":"https://api.github.com/repos/docker/docker/hooks","issue_events_url":"https://api.github.com/repos/docker/docker/issues/events{/number}","events_url":"https://api.github.com/repos/docker/docker/events","assignees_url":"https://api.github.com/repos/docker/docker/assignees{/user}","branches_url":"https://api.github.com/repos/docker/docker/branches{/branch}","tags_url":"https://api.github.com/repos/docker/docker/tags","blobs_url":"https://api.github.com/repos/docker/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/docker/languages","stargazers_url":"https://api.github.com/repos/docker/docker/stargazers","contributors_url":"https://api.github.com/repos/docker/docker/contributors","subscribers_url":"https://api.github.com/repos/docker/docker/subscribers","subscription_url":"https://api.github.com/repos/docker/docker/subscription","commits_url":"https://api.github.com/repos/docker/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/docker/contents/{+path}","compare_url":"https://api.github.com/repos/docker/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/docker/merges","archive_url":"https://api.github.com/repos/docker/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/docker/downloads","issues_url":"https://api.github.com/repos/docker/docker/issues{/number}","pulls_url":"https://api.github.com/repos/docker/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/docker/labels{/name}","releases_url":"https://api.github.com/repos/docker/docker/releases{/id}","created_at":"2013-01-18T18:10:57Z","updated_at":"2015-04-30T03:36:11Z","pushed_at":"2015-04-30T04:24:46Z","git_url":"git://github.com/docker/docker.git","ssh_url":"git@github.com:docker/docker.git","clone_url":"https://github.com/docker/docker.git","svn_url":"https://github.com/docker/docker","homepage":"http://www.docker.com","size":194582,"stargazers_count":21250,"watchers_count":21250,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4937,"mirror_url":null,"open_issues_count":969,"forks":4937,"open_issues":969,"watchers":21250,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/10535"},"html":{"href":"https://github.com/docker/docker/pull/10535"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/10535"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/10535/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/10535/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/10535/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/f9dde17bb413bd0f185ffe11f4a6084d08d16542"}}}}