{"id":3555,"date":"2016-04-03T19:02:44","date_gmt":"2016-04-03T19:02:44","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=3555"},"modified":"2016-04-03T19:02:44","modified_gmt":"2016-04-03T19:02:44","slug":"sbt-pass-arguments-main","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/sbt-pass-arguments-main\/","title":{"rendered":"SBT: pass arguments to main"},"content":{"rendered":"<p>If you write a main class in Scala, sbt will generally find it automatically:<\/p>\n<pre lang=\"scala\">\ndef main(args: Array[String]): Unit = {\n  println(args.mkString(\", \"))\n}\n<\/pre>\n<p>If you want to pass arguments to it, you can do that with run-main like so:<\/p>\n<pre lang=\"bash\">\nsbt \"run-main SSLChecker arg1 arg2\"\n<\/pre>\n<p>And you&#8217;ll get this:<\/p>\n<pre>\narg1, arg2\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If you write a main class in Scala, sbt will generally find it automatically: def main(args: Array[String]): Unit = { println(args.mkString(&#8220;, &#8220;)) } If you want to pass arguments to it, you can do that with run-main like so: sbt &#8220;run-main SSLChecker arg1 arg2&#8221; And you&#8217;ll get this: arg1, arg2<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[300,479,480],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/3555"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=3555"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/3555\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=3555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=3555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=3555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}