{"action":"created","comment":{"url":"https://api.github.com/repos/opencontainers/ocitools/pulls/comments/71930273","id":71930273,"diff_hunk":"@@ -83,19 +87,30 @@ var generateCommand = cli.Command{\n \t\t\treturn err\n \t\t}\n \n+\t\tspecgen.ExportOpts.Seccomp = context.Bool(\"seccomp-only\")\n+\n \t\tif context.IsSet(\"output\") {\n-\t\t\toutput := context.String(\"output\")\n-\t\t\terr = specgen.SaveToFile(output)\n+\t\t\tspecgen.ExportOpts.Output = context.String(\"output\")\n \t\t} else {\n-\t\t\terr = specgen.Save(os.Stdout)\n+\t\t\tspecgen.ExportOpts.Output = \"STDOUT\"","path":"cmd/ocitools/generate.go","position":40,"original_position":40,"commit_id":"0cc22df1494fccedaf8d7e37fa9c5c3a646be6a1","original_commit_id":"e09351898d327ab36615fa65f604a1e31fe1edaa","user":{"login":"GrantSeltzer","id":10857349,"avatar_url":"https://avatars.githubusercontent.com/u/10857349?v=3","gravatar_id":"","url":"https://api.github.com/users/GrantSeltzer","html_url":"https://github.com/GrantSeltzer","followers_url":"https://api.github.com/users/GrantSeltzer/followers","following_url":"https://api.github.com/users/GrantSeltzer/following{/other_user}","gists_url":"https://api.github.com/users/GrantSeltzer/gists{/gist_id}","starred_url":"https://api.github.com/users/GrantSeltzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrantSeltzer/subscriptions","organizations_url":"https://api.github.com/users/GrantSeltzer/orgs","repos_url":"https://api.github.com/users/GrantSeltzer/repos","events_url":"https://api.github.com/users/GrantSeltzer/events{/privacy}","received_events_url":"https://api.github.com/users/GrantSeltzer/received_events","type":"User","site_admin":false},"body":"Without having a function like `exportConfig` you would have to have the check for stdout/path inside both the if and the else, no? Doesn't having that relegated to one function call seem cleaner?","created_at":"2016-07-22T19:09:48Z","updated_at":"2016-07-22T19:09:48Z","html_url":"https://github.com/opencontainers/ocitools/pull/128#discussion_r71930273","pull_request_url":"https://api.github.com/repos/opencontainers/ocitools/pulls/128","_links":{"self":{"href":"https://api.github.com/repos/opencontainers/ocitools/pulls/comments/71930273"},"html":{"href":"https://github.com/opencontainers/ocitools/pull/128#discussion_r71930273"},"pull_request":{"href":"https://api.github.com/repos/opencontainers/ocitools/pulls/128"}}},"pull_request":{"url":"https://api.github.com/repos/opencontainers/ocitools/pulls/128","id":76046279,"html_url":"https://github.com/opencontainers/ocitools/pull/128","diff_url":"https://github.com/opencontainers/ocitools/pull/128.diff","patch_url":"https://github.com/opencontainers/ocitools/pull/128.patch","issue_url":"https://api.github.com/repos/opencontainers/ocitools/issues/128","number":128,"state":"open","locked":false,"title":"Use oci-seccomp-gen library for adding seccomp configurations","user":{"login":"GrantSeltzer","id":10857349,"avatar_url":"https://avatars.githubusercontent.com/u/10857349?v=3","gravatar_id":"","url":"https://api.github.com/users/GrantSeltzer","html_url":"https://github.com/GrantSeltzer","followers_url":"https://api.github.com/users/GrantSeltzer/followers","following_url":"https://api.github.com/users/GrantSeltzer/following{/other_user}","gists_url":"https://api.github.com/users/GrantSeltzer/gists{/gist_id}","starred_url":"https://api.github.com/users/GrantSeltzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrantSeltzer/subscriptions","organizations_url":"https://api.github.com/users/GrantSeltzer/orgs","repos_url":"https://api.github.com/users/GrantSeltzer/repos","events_url":"https://api.github.com/users/GrantSeltzer/events{/privacy}","received_events_url":"https://api.github.com/users/GrantSeltzer/received_events","type":"User","site_admin":false},"body":"I added functionality to specify syscalls and their arguments for all actions. Also changed default action and archs flags to ociseccompgen library. \r\n\r\nNow we can do things like:\r\n\r\n`ocitools generate --seccomp-errno clone,write --seccomp-trace getcwd --seccomp-trap umount:0:1:2:NE`\r\n\r\nThe behavior mimics that of: https://github.com/GrantSeltzer/Manhattan\r\n\r\nAlso updated man page to reflect this change. ","created_at":"2016-07-01T22:59:29Z","updated_at":"2016-07-22T19:09:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9f18ab5f6118b5b24d21c2facbc3c8d83a6666b4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/opencontainers/ocitools/pulls/128/commits","review_comments_url":"https://api.github.com/repos/opencontainers/ocitools/pulls/128/comments","review_comment_url":"https://api.github.com/repos/opencontainers/ocitools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opencontainers/ocitools/issues/128/comments","statuses_url":"https://api.github.com/repos/opencontainers/ocitools/statuses/0cc22df1494fccedaf8d7e37fa9c5c3a646be6a1","head":{"label":"GrantSeltzer:seccomp-cli-features","ref":"seccomp-cli-features","sha":"0cc22df1494fccedaf8d7e37fa9c5c3a646be6a1","user":{"login":"GrantSeltzer","id":10857349,"avatar_url":"https://avatars.githubusercontent.com/u/10857349?v=3","gravatar_id":"","url":"https://api.github.com/users/GrantSeltzer","html_url":"https://github.com/GrantSeltzer","followers_url":"https://api.github.com/users/GrantSeltzer/followers","following_url":"https://api.github.com/users/GrantSeltzer/following{/other_user}","gists_url":"https://api.github.com/users/GrantSeltzer/gists{/gist_id}","starred_url":"https://api.github.com/users/GrantSeltzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrantSeltzer/subscriptions","organizations_url":"https://api.github.com/users/GrantSeltzer/orgs","repos_url":"https://api.github.com/users/GrantSeltzer/repos","events_url":"https://api.github.com/users/GrantSeltzer/events{/privacy}","received_events_url":"https://api.github.com/users/GrantSeltzer/received_events","type":"User","site_admin":false},"repo":{"id":62420554,"name":"ocitools","full_name":"GrantSeltzer/ocitools","owner":{"login":"GrantSeltzer","id":10857349,"avatar_url":"https://avatars.githubusercontent.com/u/10857349?v=3","gravatar_id":"","url":"https://api.github.com/users/GrantSeltzer","html_url":"https://github.com/GrantSeltzer","followers_url":"https://api.github.com/users/GrantSeltzer/followers","following_url":"https://api.github.com/users/GrantSeltzer/following{/other_user}","gists_url":"https://api.github.com/users/GrantSeltzer/gists{/gist_id}","starred_url":"https://api.github.com/users/GrantSeltzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrantSeltzer/subscriptions","organizations_url":"https://api.github.com/users/GrantSeltzer/orgs","repos_url":"https://api.github.com/users/GrantSeltzer/repos","events_url":"https://api.github.com/users/GrantSeltzer/events{/privacy}","received_events_url":"https://api.github.com/users/GrantSeltzer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/GrantSeltzer/ocitools","description":"OCI runtime tools","fork":true,"url":"https://api.github.com/repos/GrantSeltzer/ocitools","forks_url":"https://api.github.com/repos/GrantSeltzer/ocitools/forks","keys_url":"https://api.github.com/repos/GrantSeltzer/ocitools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GrantSeltzer/ocitools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GrantSeltzer/ocitools/teams","hooks_url":"https://api.github.com/repos/GrantSeltzer/ocitools/hooks","issue_events_url":"https://api.github.com/repos/GrantSeltzer/ocitools/issues/events{/number}","events_url":"https://api.github.com/repos/GrantSeltzer/ocitools/events","assignees_url":"https://api.github.com/repos/GrantSeltzer/ocitools/assignees{/user}","branches_url":"https://api.github.com/repos/GrantSeltzer/ocitools/branches{/branch}","tags_url":"https://api.github.com/repos/GrantSeltzer/ocitools/tags","blobs_url":"https://api.github.com/repos/GrantSeltzer/ocitools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GrantSeltzer/ocitools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GrantSeltzer/ocitools/git/refs{/sha}","trees_url":"https://api.github.com/repos/GrantSeltzer/ocitools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GrantSeltzer/ocitools/statuses/{sha}","languages_url":"https://api.github.com/repos/GrantSeltzer/ocitools/languages","stargazers_url":"https://api.github.com/repos/GrantSeltzer/ocitools/stargazers","contributors_url":"https://api.github.com/repos/GrantSeltzer/ocitools/contributors","subscribers_url":"https://api.github.com/repos/GrantSeltzer/ocitools/subscribers","subscription_url":"https://api.github.com/repos/GrantSeltzer/ocitools/subscription","commits_url":"https://api.github.com/repos/GrantSeltzer/ocitools/commits{/sha}","git_commits_url":"https://api.github.com/repos/GrantSeltzer/ocitools/git/commits{/sha}","comments_url":"https://api.github.com/repos/GrantSeltzer/ocitools/comments{/number}","issue_comment_url":"https://api.github.com/repos/GrantSeltzer/ocitools/issues/comments{/number}","contents_url":"https://api.github.com/repos/GrantSeltzer/ocitools/contents/{+path}","compare_url":"https://api.github.com/repos/GrantSeltzer/ocitools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GrantSeltzer/ocitools/merges","archive_url":"https://api.github.com/repos/GrantSeltzer/ocitools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GrantSeltzer/ocitools/downloads","issues_url":"https://api.github.com/repos/GrantSeltzer/ocitools/issues{/number}","pulls_url":"https://api.github.com/repos/GrantSeltzer/ocitools/pulls{/number}","milestones_url":"https://api.github.com/repos/GrantSeltzer/ocitools/milestones{/number}","notifications_url":"https://api.github.com/repos/GrantSeltzer/ocitools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GrantSeltzer/ocitools/labels{/name}","releases_url":"https://api.github.com/repos/GrantSeltzer/ocitools/releases{/id}","deployments_url":"https://api.github.com/repos/GrantSeltzer/ocitools/deployments","created_at":"2016-07-01T21:25:54Z","updated_at":"2016-07-01T21:25:54Z","pushed_at":"2016-07-22T18:24:28Z","git_url":"git://github.com/GrantSeltzer/ocitools.git","ssh_url":"git@github.com:GrantSeltzer/ocitools.git","clone_url":"https://github.com/GrantSeltzer/ocitools.git","svn_url":"https://github.com/GrantSeltzer/ocitools","homepage":"https://www.opencontainers.org/","size":2749,"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":"opencontainers:master","ref":"master","sha":"55645ff06d3b1577f63192da232b5f3247b9137e","user":{"login":"opencontainers","id":12563465,"avatar_url":"https://avatars.githubusercontent.com/u/12563465?v=3","gravatar_id":"","url":"https://api.github.com/users/opencontainers","html_url":"https://github.com/opencontainers","followers_url":"https://api.github.com/users/opencontainers/followers","following_url":"https://api.github.com/users/opencontainers/following{/other_user}","gists_url":"https://api.github.com/users/opencontainers/gists{/gist_id}","starred_url":"https://api.github.com/users/opencontainers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencontainers/subscriptions","organizations_url":"https://api.github.com/users/opencontainers/orgs","repos_url":"https://api.github.com/users/opencontainers/repos","events_url":"https://api.github.com/users/opencontainers/events{/privacy}","received_events_url":"https://api.github.com/users/opencontainers/received_events","type":"Organization","site_admin":false},"repo":{"id":49598840,"name":"ocitools","full_name":"opencontainers/ocitools","owner":{"login":"opencontainers","id":12563465,"avatar_url":"https://avatars.githubusercontent.com/u/12563465?v=3","gravatar_id":"","url":"https://api.github.com/users/opencontainers","html_url":"https://github.com/opencontainers","followers_url":"https://api.github.com/users/opencontainers/followers","following_url":"https://api.github.com/users/opencontainers/following{/other_user}","gists_url":"https://api.github.com/users/opencontainers/gists{/gist_id}","starred_url":"https://api.github.com/users/opencontainers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencontainers/subscriptions","organizations_url":"https://api.github.com/users/opencontainers/orgs","repos_url":"https://api.github.com/users/opencontainers/repos","events_url":"https://api.github.com/users/opencontainers/events{/privacy}","received_events_url":"https://api.github.com/users/opencontainers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opencontainers/ocitools","description":"OCI runtime tools","fork":false,"url":"https://api.github.com/repos/opencontainers/ocitools","forks_url":"https://api.github.com/repos/opencontainers/ocitools/forks","keys_url":"https://api.github.com/repos/opencontainers/ocitools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opencontainers/ocitools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opencontainers/ocitools/teams","hooks_url":"https://api.github.com/repos/opencontainers/ocitools/hooks","issue_events_url":"https://api.github.com/repos/opencontainers/ocitools/issues/events{/number}","events_url":"https://api.github.com/repos/opencontainers/ocitools/events","assignees_url":"https://api.github.com/repos/opencontainers/ocitools/assignees{/user}","branches_url":"https://api.github.com/repos/opencontainers/ocitools/branches{/branch}","tags_url":"https://api.github.com/repos/opencontainers/ocitools/tags","blobs_url":"https://api.github.com/repos/opencontainers/ocitools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opencontainers/ocitools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opencontainers/ocitools/git/refs{/sha}","trees_url":"https://api.github.com/repos/opencontainers/ocitools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opencontainers/ocitools/statuses/{sha}","languages_url":"https://api.github.com/repos/opencontainers/ocitools/languages","stargazers_url":"https://api.github.com/repos/opencontainers/ocitools/stargazers","contributors_url":"https://api.github.com/repos/opencontainers/ocitools/contributors","subscribers_url":"https://api.github.com/repos/opencontainers/ocitools/subscribers","subscription_url":"https://api.github.com/repos/opencontainers/ocitools/subscription","commits_url":"https://api.github.com/repos/opencontainers/ocitools/commits{/sha}","git_commits_url":"https://api.github.com/repos/opencontainers/ocitools/git/commits{/sha}","comments_url":"https://api.github.com/repos/opencontainers/ocitools/comments{/number}","issue_comment_url":"https://api.github.com/repos/opencontainers/ocitools/issues/comments{/number}","contents_url":"https://api.github.com/repos/opencontainers/ocitools/contents/{+path}","compare_url":"https://api.github.com/repos/opencontainers/ocitools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opencontainers/ocitools/merges","archive_url":"https://api.github.com/repos/opencontainers/ocitools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opencontainers/ocitools/downloads","issues_url":"https://api.github.com/repos/opencontainers/ocitools/issues{/number}","pulls_url":"https://api.github.com/repos/opencontainers/ocitools/pulls{/number}","milestones_url":"https://api.github.com/repos/opencontainers/ocitools/milestones{/number}","notifications_url":"https://api.github.com/repos/opencontainers/ocitools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opencontainers/ocitools/labels{/name}","releases_url":"https://api.github.com/repos/opencontainers/ocitools/releases{/id}","deployments_url":"https://api.github.com/repos/opencontainers/ocitools/deployments","created_at":"2016-01-13T20:10:21Z","updated_at":"2016-07-21T08:36:58Z","pushed_at":"2016-07-22T18:24:28Z","git_url":"git://github.com/opencontainers/ocitools.git","ssh_url":"git@github.com:opencontainers/ocitools.git","clone_url":"https://github.com/opencontainers/ocitools.git","svn_url":"https://github.com/opencontainers/ocitools","homepage":"https://www.opencontainers.org/","size":2861,"stargazers_count":37,"watchers_count":37,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":25,"forks":22,"open_issues":25,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opencontainers/ocitools/pulls/128"},"html":{"href":"https://github.com/opencontainers/ocitools/pull/128"},"issue":{"href":"https://api.github.com/repos/opencontainers/ocitools/issues/128"},"comments":{"href":"https://api.github.com/repos/opencontainers/ocitools/issues/128/comments"},"review_comments":{"href":"https://api.github.com/repos/opencontainers/ocitools/pulls/128/comments"},"review_comment":{"href":"https://api.github.com/repos/opencontainers/ocitools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opencontainers/ocitools/pulls/128/commits"},"statuses":{"href":"https://api.github.com/repos/opencontainers/ocitools/statuses/0cc22df1494fccedaf8d7e37fa9c5c3a646be6a1"}}}}
{"actor":{"display_login":"GrantSeltzer"}}