#include "client/utils/TableFormatter.h"
#include "client/utils/CsvFormatter.h"
-using namespace std;
namespace snapper
{
- namespace cli
- {
- namespace
- {
+ using namespace std;
- const string DEFAULT_CONFIG = "root";
-
- const string DEFAULT_ROOT = "/";
-
- const vector<Option> OPTIONS = {
- Option("quiet", no_argument, 'q'),
- Option("verbose", no_argument, 'v'),
- Option("utc", no_argument),
- Option("iso", no_argument),
- Option("table-style", required_argument, 't'),
- Option("machine-readable", required_argument),
- Option("csvout", no_argument),
- Option("jsonout", no_argument),
- Option("separator", required_argument),
- Option("config", required_argument, 'c'),
- Option("no-dbus", no_argument),
- Option("root", required_argument, 'r'),
- Option("ambit", required_argument, 'a'),
- Option("version", no_argument),
- Option("help", no_argument, 'h')
- };
- }
+ string
+ GlobalOptions::help_text()
+ {
+ return string(_(" Global options:")) + '\n'
+ + _("\t--quiet, -q\t\t\tSuppress normal output.") + '\n'
+ + _("\t--verbose, -v\t\t\tIncrease verbosity.") + '\n'
+ + _("\t--utc\t\t\t\tDisplay dates and times in UTC.") + '\n'
+ + _("\t--iso\t\t\t\tDisplay dates and times in ISO format.") + '\n'
+ + _("\t--table-style, -t <style>\tTable style (integer).") + '\n'
+ + _("\t--machine-readable <format>\tSet a machine-readable output format (csv, json).") + '\n'
+ + _("\t--csvout\t\t\tSet CSV output format.") + '\n'
+ + _("\t--jsonout\t\t\tSet JSON output format.") + '\n'
+ + _("\t--separator <separator>\t\tCharacter separator for CSV output format.") + '\n'
+ + _("\t--config, -c <name>\t\tSet name of config to use.") + '\n'
+ + _("\t--no-dbus\t\t\tOperate without DBus.") + '\n'
+ + _("\t--root, -r <path>\t\tOperate on target root (works only without DBus).") + '\n'
+ + _("\t--ambit, -a ambit\t\tOperate in the specified ambit.") + '\n'
+ + _("\t--version\t\t\tPrint version and exit.") + '\n';
+ }
- string GlobalOptions::help_text()
- {
- return string(_(" Global options:")) + '\n'
- + _("\t--quiet, -q\t\t\tSuppress normal output.") + '\n'
- + _("\t--verbose, -v\t\t\tIncrease verbosity.") + '\n'
- + _("\t--utc\t\t\t\tDisplay dates and times in UTC.") + '\n'
- + _("\t--iso\t\t\t\tDisplay dates and times in ISO format.") + '\n'
- + _("\t--table-style, -t <style>\tTable style (integer).") + '\n'
- + _("\t--machine-readable <format>\tSet a machine-readable output format (csv, json).") + '\n'
- + _("\t--csvout\t\t\tSet CSV output format.") + '\n'
- + _("\t--jsonout\t\t\tSet JSON output format.") + '\n'
- + _("\t--separator <separator>\t\tCharacter separator for CSV output format.") + '\n'
- + _("\t--config, -c <name>\t\tSet name of config to use.") + '\n'
- + _("\t--no-dbus\t\t\tOperate without DBus.") + '\n'
- + _("\t--root, -r <path>\t\tOperate on target root (works only without DBus).") + '\n'
- + _("\t--ambit, -a ambit\t\tOperate in the specified ambit.") + '\n'
- + _("\t--version\t\t\tPrint version and exit.") + '\n';
- }
+ GlobalOptions::GlobalOptions(GetOpts& parser)
+ : _ambit(Ambit::AUTO)
+ {
+ const vector<Option> options = {
+ Option("quiet", no_argument, 'q'),
+ Option("verbose", no_argument, 'v'),
+ Option("utc", no_argument),
+ Option("iso", no_argument),
+ Option("table-style", required_argument, 't'),
+ Option("machine-readable", required_argument),
+ Option("csvout", no_argument),
+ Option("jsonout", no_argument),
+ Option("separator", required_argument),
+ Option("config", required_argument, 'c'),
+ Option("no-dbus", no_argument),
+ Option("root", required_argument, 'r'),
+ Option("ambit", required_argument, 'a'),
+ Option("version", no_argument),
+ Option("help", no_argument, 'h')
+ };
+
+ ParsedOpts opts = parser.parse(options);
+
+ check_options(opts);
+
+ _quiet = opts.has_option("quiet");
+ _verbose = opts.has_option("verbose");
+ _utc = opts.has_option("utc");
+ _iso = opts.has_option("iso");
+ _no_dbus = opts.has_option("no-dbus");
+ _version = opts.has_option("version");
+ _help = opts.has_option("help");
+ _table_style = table_style_value(opts);
+ _output_format = output_format_value(opts);
+ _separator = separator_value(opts);
+ _config = config_value(opts);
+ _root = root_value(opts);
+ _ambit = ambit_value(opts);
+ }
- GlobalOptions::GlobalOptions(GetOpts& parser)
- : Options(parser), _ambit(Ambit::AUTO)
+ void
+ GlobalOptions::check_options(const ParsedOpts& opts) const
+ {
+ if (opts.has_option("root") && !opts.has_option("no-dbus"))
{
- parse_options();
- check_options();
-
- _quiet = has_option("quiet");
- _verbose = has_option("verbose");
- _utc = has_option("utc");
- _iso = has_option("iso");
- _no_dbus = has_option("no-dbus");
- _version = has_option("version");
- _help = has_option("help");
- _table_style = table_style_value();
- _output_format = output_format_value();
- _separator = separator_value();
- _config = config_value();
- _root = root_value();
- _ambit = ambit_value();
- }
-
+ string error = _("root argument can be used only together with no-dbus.\n");
- void GlobalOptions::parse_options()
- {
- _options = _parser.parse(OPTIONS);
+ SN_THROW(OptionsException(error));
}
+ }
- void
- GlobalOptions::check_options() const
- {
- if (has_option("root") && !has_option("no-dbus"))
- {
- string error =_("root argument can be used only together with no-dbus.");
-
- SN_THROW(OptionsException(error));
- }
- }
+ TableLineStyle
+ GlobalOptions::table_style_value(const ParsedOpts& opts) const
+ {
+ ParsedOpts::const_iterator it = opts.find("table-style");
+ if (it == opts.end())
+ return cli::TableFormatter::default_style();
+ string str = it->second;
- TableLineStyle
- GlobalOptions::table_style_value() const
+ try
{
- if (!has_option("table-style"))
- return TableFormatter::default_style();
-
- string str = get_argument("table-style");
-
unsigned long value = stoul(str);
- if (value >= Table::numStyles)
- {
- string error = sformat(_("Invalid table style %s."), str.c_str()) + '\n' +
- sformat(_("Use an integer number from %d to %d."), 0, Table::numStyles - 1);
- SN_THROW(OptionsException(error));
- }
+ if (value >= Table::numStyles)
+ throw exception();
return (TableLineStyle)(value);
}
-
-
- GlobalOptions::OutputFormat
- GlobalOptions::output_format_value() const
+ catch (const exception&)
{
- if (has_option("csvout"))
- return OutputFormat::CSV;
+ string error = sformat(_("Invalid table style '%s'."), str.c_str()) + '\n' +
+ sformat(_("Use an integer number from %d to %d."), 0, Table::numStyles - 1);
- if (has_option("jsonout"))
- return OutputFormat::JSON;
+ SN_THROW(OptionsException(error));
+ }
- if (!has_option("machine-readable"))
- return OutputFormat::TABLE;
+ return cli::TableFormatter::default_style();
+ }
- string str = get_argument("machine-readable");
- OutputFormat output_format;
- if (!toValue(str, output_format, false))
- {
- string error = sformat(_("Invalid machine readable format %s."), str.c_str()) + '\n' +
- sformat(_("Use %s, %s or %s."), toString(OutputFormat::TABLE).c_str(),
- toString(OutputFormat::CSV).c_str(), toString(OutputFormat::JSON).c_str());
+ GlobalOptions::OutputFormat
+ GlobalOptions::output_format_value(const ParsedOpts& opts) const
+ {
+ if (opts.has_option("csvout"))
+ return OutputFormat::CSV;
- SN_THROW(OptionsException(error));
- }
+ if (opts.has_option("jsonout"))
+ return OutputFormat::JSON;
- return output_format;
- }
+ ParsedOpts::const_iterator it = opts.find("machine-readable");
+ if (it == opts.end())
+ return OutputFormat::TABLE;
+ string str = it->second;
- string
- GlobalOptions::separator_value() const
+ OutputFormat output_format;
+ if (!toValue(str, output_format, false))
{
- if (has_option("separator"))
- return get_argument("separator");
+ string error = sformat(_("Invalid machine readable format %s."), str.c_str()) + '\n' +
+ sformat(_("Use %s, %s or %s."), toString(OutputFormat::TABLE).c_str(),
+ toString(OutputFormat::CSV).c_str(), toString(OutputFormat::JSON).c_str());
- return CsvFormatter::default_separator();
+ SN_THROW(OptionsException(error));
}
+ return output_format;
+ }
- string
- GlobalOptions::config_value() const
- {
- if (has_option("config"))
- return get_argument("config");
- return DEFAULT_CONFIG;
- }
+ string
+ GlobalOptions::separator_value(const ParsedOpts& opts) const
+ {
+ ParsedOpts::const_iterator it = opts.find("separator");
+ if (it == opts.end())
+ return cli::CsvFormatter::default_separator();
+ return it->second;
+ }
- string
- GlobalOptions::root_value() const
- {
- if (has_option("root"))
- return get_argument("root");
- return DEFAULT_ROOT;
- }
+ string
+ GlobalOptions::config_value(const ParsedOpts& opts) const
+ {
+ ParsedOpts::const_iterator it = opts.find("config");
+ if (it == opts.end())
+ return "root";
+ return it->second;
+ }
- GlobalOptions::Ambit
- GlobalOptions::ambit_value() const
- {
- if (!has_option("ambit"))
- return Ambit::AUTO;
- string str = get_argument("ambit");
+ string
+ GlobalOptions::root_value(const ParsedOpts& opts) const
+ {
+ ParsedOpts::const_iterator it = opts.find("root");
+ if (it == opts.end())
+ return "/";
- Ambit ambit;
- if (!toValue(str, ambit, false))
- {
- string error = sformat(_("Invalid ambit %s."), str.c_str()) + '\n' +
- sformat(_("Use %s, %s or %s."), toString(Ambit::AUTO).c_str(),
- toString(Ambit::CLASSIC).c_str(), toString(Ambit::TRANSACTIONAL).c_str());
+ return it->second;
+ }
- SN_THROW(OptionsException(error));
- }
- return ambit;
+ GlobalOptions::Ambit
+ GlobalOptions::ambit_value(const ParsedOpts& opts) const
+ {
+ ParsedOpts::const_iterator it = opts.find("ambit");
+ if (it == opts.end())
+ return Ambit::AUTO;
+
+ string str = it->second;
+
+ Ambit ambit;
+ if (!toValue(str, ambit, false))
+ {
+ string error = sformat(_("Invalid ambit %s."), str.c_str()) + '\n' +
+ sformat(_("Use %s, %s or %s."), toString(Ambit::AUTO).c_str(),
+ toString(Ambit::CLASSIC).c_str(), toString(Ambit::TRANSACTIONAL).c_str());
+
+ SN_THROW(OptionsException(error));
}
+ return ambit;
}
- const vector<string> EnumInfo<cli::GlobalOptions::OutputFormat>::names({ "table", "csv", "json" });
- const vector<string> EnumInfo<cli::GlobalOptions::Ambit>::names({ "auto", "classic", "transactional" });
+ const vector<string> EnumInfo<GlobalOptions::OutputFormat>::names({ "table", "csv", "json" });
+
+ const vector<string> EnumInfo<GlobalOptions::Ambit>::names({ "auto", "classic", "transactional" });
}
* find current contact information at www.novell.com.
*/
-#ifndef SNAPPER_CLI_GLOBAL_OPTIONS_H
-#define SNAPPER_CLI_GLOBAL_OPTIONS_H
+#ifndef SNAPPER_GLOBAL_OPTIONS_H
+#define SNAPPER_GLOBAL_OPTIONS_H
#include <string>
#include <snapper/Enum.h>
-#include "client/Options.h"
#include "client/utils/GetOpts.h"
#include "client/utils/Table.h"
+
namespace snapper
{
- namespace cli
- {
- class GlobalOptions : public Options
- {
-
- public:
+ class GlobalOptions
+ {
- enum class OutputFormat { TABLE, CSV, JSON };
- enum class Ambit { AUTO, CLASSIC, TRANSACTIONAL };
+ public:
- static string help_text();
+ enum class OutputFormat { TABLE, CSV, JSON };
+ enum class Ambit { AUTO, CLASSIC, TRANSACTIONAL };
- GlobalOptions(GetOpts& parser);
+ static string help_text();
- bool quiet() const { return _quiet; }
- bool verbose() const { return _verbose; }
- bool utc() const { return _utc; }
- bool iso() const { return _iso; }
- bool no_dbus() const { return _no_dbus; }
- bool version() const { return _version; }
- bool help() const { return _help; }
- TableLineStyle table_style() const { return _table_style; }
- OutputFormat output_format() const { return _output_format; }
- string separator() const { return _separator; }
- string config() const { return _config; }
- string root() const { return _root; }
- Ambit ambit() const { return _ambit; }
+ GlobalOptions(GetOpts& get_opts);
- void set_ambit(Ambit ambit) { _ambit = ambit; }
+ bool quiet() const { return _quiet; }
+ bool verbose() const { return _verbose; }
+ bool utc() const { return _utc; }
+ bool iso() const { return _iso; }
+ bool no_dbus() const { return _no_dbus; }
+ bool version() const { return _version; }
+ bool help() const { return _help; }
+ TableLineStyle table_style() const { return _table_style; }
+ OutputFormat output_format() const { return _output_format; }
+ string separator() const { return _separator; }
+ string config() const { return _config; }
+ string root() const { return _root; }
+ Ambit ambit() const { return _ambit; }
- private:
+ void set_ambit(Ambit ambit) { _ambit = ambit; }
- void parse_options();
- void check_options() const;
+ private:
- TableLineStyle table_style_value() const;
- OutputFormat output_format_value() const;
- string separator_value() const;
- string config_value() const;
- string root_value() const;
- Ambit ambit_value() const;
+ void check_options(const ParsedOpts& parsed_opts) const;
- bool _quiet;
- bool _verbose;
- bool _utc;
- bool _iso;
- bool _no_dbus;
- bool _version;
- bool _help;
- TableLineStyle _table_style;
- OutputFormat _output_format;
- string _separator;
- string _config;
- string _root;
- Ambit _ambit;
+ TableLineStyle table_style_value(const ParsedOpts& parsed_opts) const;
+ OutputFormat output_format_value(const ParsedOpts& parsed_opts) const;
+ string separator_value(const ParsedOpts& parsed_opts) const;
+ string config_value(const ParsedOpts& parsed_opts) const;
+ string root_value(const ParsedOpts& parsed_opts) const;
+ Ambit ambit_value(const ParsedOpts& parsed_opts) const;
- };
+ bool _quiet;
+ bool _verbose;
+ bool _utc;
+ bool _iso;
+ bool _no_dbus;
+ bool _version;
+ bool _help;
+ TableLineStyle _table_style;
+ OutputFormat _output_format;
+ string _separator;
+ string _config;
+ string _root;
+ Ambit _ambit;
- }
+ };
- template <> struct EnumInfo<cli::GlobalOptions::OutputFormat> { static const vector<string> names; };
+ template <> struct EnumInfo<GlobalOptions::OutputFormat> { static const vector<string> names; };
- template <> struct EnumInfo<cli::GlobalOptions::Ambit> { static const vector<string> names; };
+ template <> struct EnumInfo<GlobalOptions::Ambit> { static const vector<string> names; };
}
struct Cmd
{
- typedef void (*cmd_func_t)(cli::GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers,
+ typedef void (*cmd_func_t)(GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers,
ProxySnapper* snapper);
typedef void (*help_func_t)();
void
-command_list_configs(cli::GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper*)
+command_list_configs(GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper*)
{
cli::Command::ListConfigs command(global_options, get_opts, *snappers);
void
-command_create_config(cli::GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper*)
+command_create_config(GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper*)
{
const vector<Option> options = {
Option("fstype", required_argument, 'f'),
void
-command_delete_config(cli::GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper*)
+command_delete_config(GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper*)
{
get_opts.parse("delete-config", GetOpts::no_options);
if (get_opts.has_args())
void
-command_get_config(cli::GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper*)
+command_get_config(GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper*)
{
cli::Command::GetConfig command(global_options, get_opts, *snappers);
void
-command_set_config(cli::GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
+command_set_config(GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
{
get_opts.parse("set-config", GetOpts::no_options);
if (!get_opts.has_args())
void
-command_list(cli::GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper*)
+command_list(GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper*)
{
cli::Command::ListSnapshots command(global_options, get_opts, *snappers);
void
-command_create(cli::GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
+command_create(GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
{
const vector<Option> options = {
Option("type", required_argument, 't'),
void
-command_modify(cli::GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
+command_modify(GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
{
const vector<Option> options = {
Option("description", required_argument, 'd'),
void
-command_delete(cli::GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
+command_delete(GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
{
const vector<Option> options = {
Option("sync", no_argument, 's')
void
-command_mount(cli::GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
+command_mount(GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
{
get_opts.parse("mount", GetOpts::no_options);
if (!get_opts.has_args())
void
-command_umount(cli::GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
+command_umount(GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
{
get_opts.parse("umount", GetOpts::no_options);
if (!get_opts.has_args())
void
-command_status(cli::GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
+command_status(GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
{
const vector<Option> options = {
Option("output", required_argument, 'o')
void
-command_diff(cli::GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
+command_diff(GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
{
const vector<Option> options = {
Option("input", required_argument, 'i'),
void
-command_undo(cli::GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
+command_undo(GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
{
const vector<Option> options = {
Option("input", required_argument, 'i')
void
-command_rollback(cli::GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
+command_rollback(GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
{
const vector<Option> options = {
Option("print-number", no_argument, 'p'),
ProxySnapshots::iterator previous_default = snapshots.getDefault();
- if (global_options.ambit() == cli::GlobalOptions::Ambit::AUTO)
+ if (global_options.ambit() == GlobalOptions::Ambit::AUTO)
{
if (previous_default == snapshots.end())
{
}
if (filesystem->isSnapshotReadOnly(previous_default->getNum()))
- global_options.set_ambit(cli::GlobalOptions::Ambit::TRANSACTIONAL);
+ global_options.set_ambit(GlobalOptions::Ambit::TRANSACTIONAL);
else
- global_options.set_ambit(cli::GlobalOptions::Ambit::CLASSIC);
+ global_options.set_ambit(GlobalOptions::Ambit::CLASSIC);
}
if (!global_options.quiet())
switch (global_options.ambit())
{
- case cli::GlobalOptions::Ambit::CLASSIC:
+ case GlobalOptions::Ambit::CLASSIC:
{
ProxySnapshots::const_iterator snapshot1 = snapshots.end();
ProxySnapshots::const_iterator snapshot2 = snapshots.end();
}
break;
- case cli::GlobalOptions::Ambit::TRANSACTIONAL:
+ case GlobalOptions::Ambit::TRANSACTIONAL:
{
// see bsc #1172273
}
break;
- case cli::GlobalOptions::Ambit::AUTO:
+ case GlobalOptions::Ambit::AUTO:
{
cerr << "internal error: ambit is auto" << endl;
exit(EXIT_FAILURE);
void
-command_setup_quota(cli::GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
+command_setup_quota(GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
{
ParsedOpts opts = get_opts.parse("setup-quota", GetOpts::no_options);
if (get_opts.num_args() != 0)
void
-command_cleanup(cli::GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
+command_cleanup(GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
{
ParsedOpts opts = get_opts.parse("cleanup", GetOpts::no_options);
if (get_opts.num_args() != 1)
void
-command_debug(cli::GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper*)
+command_debug(GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper*)
{
get_opts.parse("debug", GetOpts::no_options);
if (get_opts.has_args())
}
void
-command_xa_diff(cli::GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
+command_xa_diff(GlobalOptions& global_options, GetOpts& get_opts, ProxySnappers* snappers, ProxySnapper* snapper)
{
ParsedOpts opts = get_opts.parse("xadiff", GetOpts::no_options);
if (get_opts.num_args() < 1)
cout << _("usage: snapper [--global-options] <command> [--command-options] [command-arguments]") << '\n'
<< endl;
- cout << cli::GlobalOptions::help_text() << endl;
+ cout << GlobalOptions::help_text() << endl;
for (const Cmd& cmd : cmds)
(*cmd.help_func)();
{
GetOpts get_opts(argc, argv);
- cli::GlobalOptions global_options(get_opts);
+ GlobalOptions global_options(get_opts);
if (global_options.version())
{