Skip to content

Commit

Permalink
make banner configurable from CLI, add link to patreon page, 0.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi committed May 1, 2017
1 parent 335b657 commit 5d0aa4f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions amm/src/main/scala/ammonite/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,19 @@ object Main{
// Primary arguments that correspond to the arguments of
// the `Main` configuration object
head("ammonite", ammonite.Constants.version)

opt[String]('p', "predef")
.action((x, c) => c.copy(predef = x))
.text("Any commands you want to execute at the start of the REPL session")

opt[Unit]("no-default-predef")
.action((x, c) => c.copy(defaultPredef = false))
.text("Disable the default predef and run Ammonite with the minimal predef possible")

opt[String]('b', "banner")
.action((x, c) => c.copy(welcomeBanner = Some(x)))
.text("Customize the welcome banner that gets shown when Ammonite starts")

// Secondary arguments that correspond to different methods of
// the `Main` configuration arguments
arg[String]("<file-args>...")
Expand Down Expand Up @@ -245,6 +251,7 @@ object Main{
}
}
},
welcomeBanner = c.welcomeBanner,
verboseOutput = verboseOutput
)
(fileToExecute, codeToExecute) match {
Expand Down
3 changes: 2 additions & 1 deletion amm/src/main/scala/ammonite/main/Defaults.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ object Defaults{
def javaVersion = System.getProperty("java.version")
Util.normalizeNewlines(
s"""Welcome to the Ammonite Repl $ammoniteVersion
|(Scala $scalaVersion Java $javaVersion)""".stripMargin
|(Scala $scalaVersion Java $javaVersion)
|If you like Ammonite, please support our development at www.patreon.com/lihaoyi""".stripMargin
)
}
val ignoreUselessImports = """
Expand Down
5 changes: 5 additions & 0 deletions readme/Footer.scalatex
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@


@sect{Changelog}
@sect{0.8.4}
@ul
@li
Make startup banner configurable via a command line flag

@sect{0.8.3}
@ul
@li
Expand Down

0 comments on commit 5d0aa4f

Please sign in to comment.