40 static void init_options() {
42 (
"no-log-sync",
boo()->default_value(
false),
43 "Don't sync rangeserver commit logs on autoflush")
44 (
"output-only",
"Display status output and exit with status 0")
45 (
"profile",
"Send profiling output to stderr")
46 (
"namespace",
str()->default_value(
""),
47 "Automatically use specified namespace when starting")
48 (
"silent-startup",
"Squelch output during startup")
50 alias(
"no-log-sync",
"Hypertable.HqlInterpreter.Mutator.NoLogSync");
56 typedef Meta::list<AppPolicy, CommandShellPolicy, DefaultCommPolicy>
Policies;
59 int main(
int argc,
char **argv) {
68 init_with_policies<Policies>(argc, argv);
69 bool profile =
has(
"profile");
70 output_only =
has(
"output-only");
71 silent =
has(
"silent") && get_bool(
"silent");
73 if (
has(
"silent-startup")) {
79 interp = make_shared<HqlCommandInterpreter>(hypertable, profile);
80 shell = make_shared<CommandShell>(
"hypertable",
"Hypertable", interp,
properties);
81 shell->set_namespace(get_str(
"namespace"));
82 interp->set_silent(shell->silent());
83 interp->set_test_mode(shell->test_mode());
90 const char *msg = e.what();
95 quick_exit(output_only ? 0 : 2);
Interface and base of config policy.
PropertiesPtr properties
This singleton map stores all options.
Po::typed_value< String > * str(String *v=0)
Desc & cmdline_desc(const char *usage)
A macro which definds global functions like get_bool(), get_str(), get_i16() etc. ...
bool has(const String &name)
Check existence of a configuration value.
Declaration for ConsoleOutputSquelcher.
Meta::list< AppPolicy, CommandShellPolicy, DefaultCommPolicy > Policies
const char * get_text(int error)
Returns a descriptive error message.
bool status(ContextPtr &context, Timer &timer, Status &status)
Runs a status check on the master.
Compatibility Macros for C/C++.
Po::typed_value< bool > * boo(bool *v=0)
Initialization helper for applications.
std::shared_ptr< CommandInterpreter > CommandInterpreterPtr
std::shared_ptr< CommandShell > CommandShellPtr
Declarations for HqlCommandInterpreter.
Temporarily redirects stdout and stderr to /dev/null.
This is a generic exception class for Hypertable.
int main(int argc, char **argv)
void alias(const String &cmdline_opt, const String &file_opt, bool overwrite)
Setup command line option alias for config file option.
int code() const
Returns the error code.