java - Remove commands from Spring-Shell -
i'm looking build diagnostic utility using spring-shell
tech support team. idea drop executable jar
on system, run app , have run through bunch of diagnostics.
i want disable/remove of commands auto-loaded org.springframework.shell.commands
package, , can't quite figure out how that. possible?
failing that, customize command can output own help. can't work, though able figure out how remove them list of commands display when user hits tab.
@cliavailabilityindicator({"!", "//", "script","system"}) public boolean isavailable() { return false; }
any ideas?
turns out, according http://docs.spring.io/spring-shell/docs/current/reference/htmlsingle/#d4e173, spring shell apps can called command line argument disable internal commands. did in application's main method add argument myself.
public static void main(string[] args) throws ioexception { arraylist<string> argslist = new arraylist<string>(arrays.aslist(args)); argslist.add("--disableinternalcommands"); string[] argsarray = new string[argslist.size()]; argsarray = argslist.toarray(argsarray); bootstrap.main(argsarray); }
there's cleaner way add argument args parameter...but that's outside scope of question.
Comments
Post a Comment