39 "Usage: get_property [options] <property>\n\nOptions"
42 struct AppPolicy :
Policy {
43 static void init_options() {
50 lookup_property = get_str(
"property");
59 try { cout << exp; goto bail; } catch (Exception &e) { if (t) throw e; }
61 int main(
int argc,
char **argv)
64 init_with_policy<Policies>(argc, argv);
76 cout << lookup_property <<
"-PROPERTY-DOES-NOT-EXIST";
85 quick_exit(EXIT_SUCCESS);
Declarations for configuration properties.
Interface and base of config policy.
PropertiesPtr properties
This singleton map stores all options.
std::string String
A String is simply a typedef to std::string.
void init(int argc, char *argv[], const Desc *desc=NULL)
Initialize with default policy.
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.
Helpers to compose init policies; allow to combine two policies into one.
Compatibility Macros for C/C++.
Initialization helper for applications.
int main(int argc, char **argv)
Meta::list< MyPolicy, DefaultPolicy > Policies
This is a generic exception class for Hypertable.
Desc & cmdline_hidden_desc()
Get the command line hidden options description (for positional options)
PositionalDesc & cmdline_positional_desc()
Get the command line positional options description.