mirror of https://github.com/sbt/sbt.git
don't print help for internal commands
This commit is contained in:
parent
9d6a4f70f7
commit
16e2b71ccc
|
|
@ -44,7 +44,9 @@ object Command
|
||||||
new Command { def applies = f }
|
new Command { def applies = f }
|
||||||
def apply(f: PartialFunction[State, Apply]): Command =
|
def apply(f: PartialFunction[State, Apply]): Command =
|
||||||
direct(f.lift)
|
direct(f.lift)
|
||||||
|
|
||||||
|
def simple(name: String, help: Help*)(f: (Input, State) => State): Command =
|
||||||
|
univ( Apply.simple(name, help : _*)(f) )
|
||||||
def simple(name: String, brief: (String, String), detail: String)(f: (Input, State) => State): Command =
|
def simple(name: String, brief: (String, String), detail: String)(f: (Input, State) => State): Command =
|
||||||
univ( Apply.simple(name, brief, detail)(f) )
|
univ( Apply.simple(name, brief, detail)(f) )
|
||||||
}
|
}
|
||||||
|
|
@ -63,8 +65,10 @@ object Apply
|
||||||
def simple(name: String, brief: (String, String), detail: String)(f: (Input, State) => State): State => Apply =
|
def simple(name: String, brief: (String, String), detail: String)(f: (Input, State) => State): State => Apply =
|
||||||
{
|
{
|
||||||
val h = Help(brief, (Set(name), detail) )
|
val h = Help(brief, (Set(name), detail) )
|
||||||
s => Apply( h ){ case in if name == in.name => f( in, s) }
|
simple(name, h)(f)
|
||||||
}
|
}
|
||||||
|
def simple(name: String, help: Help*)(f: (Input, State) => State): State => Apply =
|
||||||
|
s => Apply( help: _* ){ case in if name == in.name => f( in, s) }
|
||||||
}
|
}
|
||||||
|
|
||||||
trait Logged
|
trait Logged
|
||||||
|
|
|
||||||
|
|
@ -125,11 +125,11 @@ object Commands
|
||||||
runExitHooks(s).reload
|
runExitHooks(s).reload
|
||||||
}
|
}
|
||||||
|
|
||||||
def defaults = Command.simple(DefaultsCommand, DefaultsBrief, DefaultsDetailed) { (in, s) =>
|
def defaults = Command.simple(DefaultsCommand) { (in, s) =>
|
||||||
s ++ DefaultCommands
|
s ++ DefaultCommands
|
||||||
}
|
}
|
||||||
|
|
||||||
def initialize = Command.simple(InitCommand, InitBrief, InitDetailed) { (in, s) =>
|
def initialize = Command.simple(InitCommand) { (in, s) =>
|
||||||
/*"load-commands -base ~/.sbt/commands" :: */readLines( readable( sbtRCs(s) ) ) ::: s
|
/*"load-commands -base ~/.sbt/commands" :: */readLines( readable( sbtRCs(s) ) ) ::: s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue