From: Josef Reidinger Date: Tue, 26 May 2015 08:52:17 +0000 (+0200) Subject: changes from review X-Git-Tag: v0.2.8~9^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f38f6305224f5a719df21824563be8efc72ac286;p=thirdparty%2Fsnapper.git changes from review --- diff --git a/client/snapper.cc b/client/snapper.cc index 6ae90ccb..00f2c91b 100644 --- a/client/snapper.cc +++ b/client/snapper.cc @@ -87,6 +87,7 @@ bool utc = false; bool iso = false; string config_name = "root"; bool no_dbus = false; +string target_root = "/"; struct MyFiles : public Files @@ -210,7 +211,7 @@ help_list_configs() list> -enum_configs(DBus::Connection* conn, const string& target_root = "/") +enum_configs(DBus::Connection* conn) { list> configs; @@ -238,11 +239,7 @@ enum_configs(DBus::Connection* conn, const string& target_root = "/") void command_list_configs(DBus::Connection* conn, Snapper* snapper) { - const struct option options[] = { - { "target-root", optional_argument, 0, 'r' }, - { 0, 0, 0, 0 } - }; - GetOpts::parsed_opts opts = getopts.parse("list-configs", options); + GetOpts::parsed_opts opts = getopts.parse("list-configs", GetOpts::no_options); if (getopts.hasArgs()) { @@ -250,13 +247,6 @@ command_list_configs(DBus::Connection* conn, Snapper* snapper) exit(EXIT_FAILURE); } - string target_root = "/"; - - GetOpts::parsed_opts::const_iterator opt; - - if ((opt = opts.find("target-root")) != opts.end()) - target_root = opt->second; - Table table; TableHeader header; @@ -264,7 +254,7 @@ command_list_configs(DBus::Connection* conn, Snapper* snapper) header.add(_("Subvolume")); table.setHeader(header); - list > configs = enum_configs(conn, target_root); + list > configs = enum_configs(conn); for (list >::iterator it = configs.begin(); it != configs.end(); ++it) { @@ -1588,6 +1578,7 @@ help(const list& cmds) << _("\t--table-style, -t