{"action":"created","comment":{"url":"https://api.github.com/repos/druid-io/tranquility/pulls/comments/49245789","id":49245789,"diff_hunk":"@@ -52,18 +54,25 @@ import org.eclipse.jetty.util.thread.QueuedThreadPool\n import org.scala_tools.time.Imports._\n import org.skife.config.ConfigurationObjectFactory\n \n-object Main\n+object ServerMain extends App\n {\n   private val ConfigResource = \"tranquility-server.yaml\"\n \n-  def main(args: Array[String]): Unit = {\n-    val configInputStream = if (args.isEmpty) {\n-      getClass.getClassLoader.getResourceAsStream(ConfigResource) mapNull {\n-        System.err.println(s\"Expected resource $ConfigResource (or provide path on the command line)\")\n-        sys.exit(1)\n-      }\n-    } else {\n-      new FileInputStream(args(0))\n+  private val configFile: Flag[String] = flag(\n+    \"configFile\",\n+    s\"Path to alternate config file, from working directory (default: $ConfigResource from classpath)\"\n+  )\n+\n+  def main(): Unit = {\n+    val configInputStream = configFile.get match {\n+      case Some(file) =>\n+        new FileInputStream(file)\n+\n+      case None =>\n+        getClass.getClassLoader.getResourceAsStream(ConfigResource) mapNull {","path":"server/src/main/scala/com/metamx/tranquility/server/http/ServerMain.scala","position":37,"original_position":37,"commit_id":"2555f7be6d860c41f59cea3a3d93dc22c2fc54af","original_commit_id":"2555f7be6d860c41f59cea3a3d93dc22c2fc54af","user":{"login":"gianm","id":1214075,"avatar_url":"https://avatars.githubusercontent.com/u/1214075?v=3","gravatar_id":"","url":"https://api.github.com/users/gianm","html_url":"https://github.com/gianm","followers_url":"https://api.github.com/users/gianm/followers","following_url":"https://api.github.com/users/gianm/following{/other_user}","gists_url":"https://api.github.com/users/gianm/gists{/gist_id}","starred_url":"https://api.github.com/users/gianm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gianm/subscriptions","organizations_url":"https://api.github.com/users/gianm/orgs","repos_url":"https://api.github.com/users/gianm/repos","events_url":"https://api.github.com/users/gianm/events{/privacy}","received_events_url":"https://api.github.com/users/gianm/received_events","type":"User","site_admin":false},"body":"Does that matter for a main?","created_at":"2016-01-08T22:23:07Z","updated_at":"2016-01-08T22:23:07Z","html_url":"https://github.com/druid-io/tranquility/pull/84#discussion_r49245789","pull_request_url":"https://api.github.com/repos/druid-io/tranquility/pulls/84","_links":{"self":{"href":"https://api.github.com/repos/druid-io/tranquility/pulls/comments/49245789"},"html":{"href":"https://github.com/druid-io/tranquility/pull/84#discussion_r49245789"},"pull_request":{"href":"https://api.github.com/repos/druid-io/tranquility/pulls/84"}}},"pull_request":{"url":"https://api.github.com/repos/druid-io/tranquility/pulls/84","id":55505063,"html_url":"https://github.com/druid-io/tranquility/pull/84","diff_url":"https://github.com/druid-io/tranquility/pull/84.diff","patch_url":"https://github.com/druid-io/tranquility/pull/84.patch","issue_url":"https://api.github.com/repos/druid-io/tranquility/issues/84","number":84,"state":"open","locked":false,"title":"Server: Switch to real arg parsing, and rename Main to ServerMain.","user":{"login":"gianm","id":1214075,"avatar_url":"https://avatars.githubusercontent.com/u/1214075?v=3","gravatar_id":"","url":"https://api.github.com/users/gianm","html_url":"https://github.com/gianm","followers_url":"https://api.github.com/users/gianm/followers","following_url":"https://api.github.com/users/gianm/following{/other_user}","gists_url":"https://api.github.com/users/gianm/gists{/gist_id}","starred_url":"https://api.github.com/users/gianm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gianm/subscriptions","organizations_url":"https://api.github.com/users/gianm/orgs","repos_url":"https://api.github.com/users/gianm/repos","events_url":"https://api.github.com/users/gianm/events{/privacy}","received_events_url":"https://api.github.com/users/gianm/received_events","type":"User","site_admin":false},"body":"Real arg parsing is probably a better idea than reading `args(0)`.","created_at":"2016-01-08T20:12:42Z","updated_at":"2016-01-08T22:23:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7da107cccd943b50c1f13acb915d4fe5813f01a3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/druid-io/tranquility/pulls/84/commits","review_comments_url":"https://api.github.com/repos/druid-io/tranquility/pulls/84/comments","review_comment_url":"https://api.github.com/repos/druid-io/tranquility/pulls/comments{/number}","comments_url":"https://api.github.com/repos/druid-io/tranquility/issues/84/comments","statuses_url":"https://api.github.com/repos/druid-io/tranquility/statuses/2555f7be6d860c41f59cea3a3d93dc22c2fc54af","head":{"label":"gianm:server-main","ref":"server-main","sha":"2555f7be6d860c41f59cea3a3d93dc22c2fc54af","user":{"login":"gianm","id":1214075,"avatar_url":"https://avatars.githubusercontent.com/u/1214075?v=3","gravatar_id":"","url":"https://api.github.com/users/gianm","html_url":"https://github.com/gianm","followers_url":"https://api.github.com/users/gianm/followers","following_url":"https://api.github.com/users/gianm/following{/other_user}","gists_url":"https://api.github.com/users/gianm/gists{/gist_id}","starred_url":"https://api.github.com/users/gianm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gianm/subscriptions","organizations_url":"https://api.github.com/users/gianm/orgs","repos_url":"https://api.github.com/users/gianm/repos","events_url":"https://api.github.com/users/gianm/events{/privacy}","received_events_url":"https://api.github.com/users/gianm/received_events","type":"User","site_admin":false},"repo":{"id":35352803,"name":"tranquility","full_name":"gianm/tranquility","owner":{"login":"gianm","id":1214075,"avatar_url":"https://avatars.githubusercontent.com/u/1214075?v=3","gravatar_id":"","url":"https://api.github.com/users/gianm","html_url":"https://github.com/gianm","followers_url":"https://api.github.com/users/gianm/followers","following_url":"https://api.github.com/users/gianm/following{/other_user}","gists_url":"https://api.github.com/users/gianm/gists{/gist_id}","starred_url":"https://api.github.com/users/gianm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gianm/subscriptions","organizations_url":"https://api.github.com/users/gianm/orgs","repos_url":"https://api.github.com/users/gianm/repos","events_url":"https://api.github.com/users/gianm/events{/privacy}","received_events_url":"https://api.github.com/users/gianm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gianm/tranquility","description":"Regenerates all nearby group members for 2569 to 2986 every 2 seconds for 10 sec.","fork":true,"url":"https://api.github.com/repos/gianm/tranquility","forks_url":"https://api.github.com/repos/gianm/tranquility/forks","keys_url":"https://api.github.com/repos/gianm/tranquility/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gianm/tranquility/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gianm/tranquility/teams","hooks_url":"https://api.github.com/repos/gianm/tranquility/hooks","issue_events_url":"https://api.github.com/repos/gianm/tranquility/issues/events{/number}","events_url":"https://api.github.com/repos/gianm/tranquility/events","assignees_url":"https://api.github.com/repos/gianm/tranquility/assignees{/user}","branches_url":"https://api.github.com/repos/gianm/tranquility/branches{/branch}","tags_url":"https://api.github.com/repos/gianm/tranquility/tags","blobs_url":"https://api.github.com/repos/gianm/tranquility/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gianm/tranquility/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gianm/tranquility/git/refs{/sha}","trees_url":"https://api.github.com/repos/gianm/tranquility/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gianm/tranquility/statuses/{sha}","languages_url":"https://api.github.com/repos/gianm/tranquility/languages","stargazers_url":"https://api.github.com/repos/gianm/tranquility/stargazers","contributors_url":"https://api.github.com/repos/gianm/tranquility/contributors","subscribers_url":"https://api.github.com/repos/gianm/tranquility/subscribers","subscription_url":"https://api.github.com/repos/gianm/tranquility/subscription","commits_url":"https://api.github.com/repos/gianm/tranquility/commits{/sha}","git_commits_url":"https://api.github.com/repos/gianm/tranquility/git/commits{/sha}","comments_url":"https://api.github.com/repos/gianm/tranquility/comments{/number}","issue_comment_url":"https://api.github.com/repos/gianm/tranquility/issues/comments{/number}","contents_url":"https://api.github.com/repos/gianm/tranquility/contents/{+path}","compare_url":"https://api.github.com/repos/gianm/tranquility/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gianm/tranquility/merges","archive_url":"https://api.github.com/repos/gianm/tranquility/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gianm/tranquility/downloads","issues_url":"https://api.github.com/repos/gianm/tranquility/issues{/number}","pulls_url":"https://api.github.com/repos/gianm/tranquility/pulls{/number}","milestones_url":"https://api.github.com/repos/gianm/tranquility/milestones{/number}","notifications_url":"https://api.github.com/repos/gianm/tranquility/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gianm/tranquility/labels{/name}","releases_url":"https://api.github.com/repos/gianm/tranquility/releases{/id}","created_at":"2015-05-10T01:47:31Z","updated_at":"2015-09-04T15:54:29Z","pushed_at":"2016-01-08T20:11:54Z","git_url":"git://github.com/gianm/tranquility.git","ssh_url":"git@github.com:gianm/tranquility.git","clone_url":"https://github.com/gianm/tranquility.git","svn_url":"https://github.com/gianm/tranquility","homepage":"","size":649,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"druid-io:master","ref":"master","sha":"e1d92848b3924e9146496241fdb6f79eb953e742","user":{"login":"druid-io","id":4203474,"avatar_url":"https://avatars.githubusercontent.com/u/4203474?v=3","gravatar_id":"","url":"https://api.github.com/users/druid-io","html_url":"https://github.com/druid-io","followers_url":"https://api.github.com/users/druid-io/followers","following_url":"https://api.github.com/users/druid-io/following{/other_user}","gists_url":"https://api.github.com/users/druid-io/gists{/gist_id}","starred_url":"https://api.github.com/users/druid-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/druid-io/subscriptions","organizations_url":"https://api.github.com/users/druid-io/orgs","repos_url":"https://api.github.com/users/druid-io/repos","events_url":"https://api.github.com/users/druid-io/events{/privacy}","received_events_url":"https://api.github.com/users/druid-io/received_events","type":"Organization","site_admin":false},"repo":{"id":16817857,"name":"tranquility","full_name":"druid-io/tranquility","owner":{"login":"druid-io","id":4203474,"avatar_url":"https://avatars.githubusercontent.com/u/4203474?v=3","gravatar_id":"","url":"https://api.github.com/users/druid-io","html_url":"https://github.com/druid-io","followers_url":"https://api.github.com/users/druid-io/followers","following_url":"https://api.github.com/users/druid-io/following{/other_user}","gists_url":"https://api.github.com/users/druid-io/gists{/gist_id}","starred_url":"https://api.github.com/users/druid-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/druid-io/subscriptions","organizations_url":"https://api.github.com/users/druid-io/orgs","repos_url":"https://api.github.com/users/druid-io/repos","events_url":"https://api.github.com/users/druid-io/events{/privacy}","received_events_url":"https://api.github.com/users/druid-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/druid-io/tranquility","description":"Tranquility helps you send real-time event streams to Druid and handles partitioning, replication, service discovery, and schema rollover, seamlessly and without downtime.","fork":false,"url":"https://api.github.com/repos/druid-io/tranquility","forks_url":"https://api.github.com/repos/druid-io/tranquility/forks","keys_url":"https://api.github.com/repos/druid-io/tranquility/keys{/key_id}","collaborators_url":"https://api.github.com/repos/druid-io/tranquility/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/druid-io/tranquility/teams","hooks_url":"https://api.github.com/repos/druid-io/tranquility/hooks","issue_events_url":"https://api.github.com/repos/druid-io/tranquility/issues/events{/number}","events_url":"https://api.github.com/repos/druid-io/tranquility/events","assignees_url":"https://api.github.com/repos/druid-io/tranquility/assignees{/user}","branches_url":"https://api.github.com/repos/druid-io/tranquility/branches{/branch}","tags_url":"https://api.github.com/repos/druid-io/tranquility/tags","blobs_url":"https://api.github.com/repos/druid-io/tranquility/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/druid-io/tranquility/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/druid-io/tranquility/git/refs{/sha}","trees_url":"https://api.github.com/repos/druid-io/tranquility/git/trees{/sha}","statuses_url":"https://api.github.com/repos/druid-io/tranquility/statuses/{sha}","languages_url":"https://api.github.com/repos/druid-io/tranquility/languages","stargazers_url":"https://api.github.com/repos/druid-io/tranquility/stargazers","contributors_url":"https://api.github.com/repos/druid-io/tranquility/contributors","subscribers_url":"https://api.github.com/repos/druid-io/tranquility/subscribers","subscription_url":"https://api.github.com/repos/druid-io/tranquility/subscription","commits_url":"https://api.github.com/repos/druid-io/tranquility/commits{/sha}","git_commits_url":"https://api.github.com/repos/druid-io/tranquility/git/commits{/sha}","comments_url":"https://api.github.com/repos/druid-io/tranquility/comments{/number}","issue_comment_url":"https://api.github.com/repos/druid-io/tranquility/issues/comments{/number}","contents_url":"https://api.github.com/repos/druid-io/tranquility/contents/{+path}","compare_url":"https://api.github.com/repos/druid-io/tranquility/compare/{base}...{head}","merges_url":"https://api.github.com/repos/druid-io/tranquility/merges","archive_url":"https://api.github.com/repos/druid-io/tranquility/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/druid-io/tranquility/downloads","issues_url":"https://api.github.com/repos/druid-io/tranquility/issues{/number}","pulls_url":"https://api.github.com/repos/druid-io/tranquility/pulls{/number}","milestones_url":"https://api.github.com/repos/druid-io/tranquility/milestones{/number}","notifications_url":"https://api.github.com/repos/druid-io/tranquility/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/druid-io/tranquility/labels{/name}","releases_url":"https://api.github.com/repos/druid-io/tranquility/releases{/id}","created_at":"2014-02-13T21:30:05Z","updated_at":"2016-01-05T11:38:45Z","pushed_at":"2016-01-08T20:12:43Z","git_url":"git://github.com/druid-io/tranquility.git","ssh_url":"git@github.com:druid-io/tranquility.git","clone_url":"https://github.com/druid-io/tranquility.git","svn_url":"https://github.com/druid-io/tranquility","homepage":"","size":684,"stargazers_count":103,"watchers_count":103,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":40,"mirror_url":null,"open_issues_count":16,"forks":40,"open_issues":16,"watchers":103,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/druid-io/tranquility/pulls/84"},"html":{"href":"https://github.com/druid-io/tranquility/pull/84"},"issue":{"href":"https://api.github.com/repos/druid-io/tranquility/issues/84"},"comments":{"href":"https://api.github.com/repos/druid-io/tranquility/issues/84/comments"},"review_comments":{"href":"https://api.github.com/repos/druid-io/tranquility/pulls/84/comments"},"review_comment":{"href":"https://api.github.com/repos/druid-io/tranquility/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/druid-io/tranquility/pulls/84/commits"},"statuses":{"href":"https://api.github.com/repos/druid-io/tranquility/statuses/2555f7be6d860c41f59cea3a3d93dc22c2fc54af"}}}}