
org.jsimpledb.cli.cmd.SetVerboseCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsimpledb-cli Show documentation
Show all versions of jsimpledb-cli Show documentation
JSimpleDB classes supporting command line interfaces.
The newest version!
/*
* Copyright (C) 2015 Archie L. Cobbs. All rights reserved.
*/
package org.jsimpledb.cli.cmd;
import java.util.Map;
import org.jsimpledb.cli.CliSession;
import org.jsimpledb.util.ParseContext;
public class SetVerboseCommand extends AbstractCommand {
public SetVerboseCommand() {
super("set-verbose verbose:boolean");
}
@Override
public String getHelpSummary() {
return "Enables or disables verbose mode, which displays the complete stack trace when an exceptions occurs.";
}
@Override
public CliSession.Action getAction(CliSession session0, ParseContext ctx, boolean complete, Map params) {
final boolean verbose = (Boolean)params.get("verbose");
return session -> {
session.setVerbose(verbose);
session.getWriter().println((verbose ? "En" : "Dis") + "abled verbose mode.");
};
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy