]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- added aliases for some snapper commands 86/head
authorArvin Schnell <aschnell@suse.de>
Mon, 2 Jun 2014 12:55:14 +0000 (14:55 +0200)
committerArvin Schnell <aschnell@suse.de>
Mon, 2 Jun 2014 12:55:14 +0000 (14:55 +0200)
client/snapper.cc
doc/snapper.xml.in
package/snapper.changes

index 8546f3ad1d41cbff8132ddc51dee085db923c16f..44d744f0cb6e7fed912fff9f8abb46bb2c67a2f2 100644 (file)
@@ -66,7 +66,14 @@ struct Cmd
          works_without_dbus(works_without_dbus), needs_snapper(needs_snapper)
     {}
 
+    Cmd(const string& name, const vector<string>& aliases, cmd_func_t cmd_func,
+       help_func_t help_func, bool works_without_dbus, bool needs_snapper)
+       : name(name), aliases(aliases), cmd_func(cmd_func), help_func(help_func),
+         works_without_dbus(works_without_dbus), needs_snapper(needs_snapper)
+    {}
+
     const string name;
+    const vector<string> aliases;
     const cmd_func_t cmd_func;
     const help_func_t help_func;
     const bool works_without_dbus;
@@ -1491,10 +1498,10 @@ main(int argc, char** argv)
     cmds.push_back(Cmd("delete-config", command_delete_config, help_delete_config, true, false));
     cmds.push_back(Cmd("get-config", command_get_config, help_get_config, true, false));
     cmds.push_back(Cmd("set-config", command_set_config, help_set_config, true, true));
-    cmds.push_back(Cmd("list", command_list, help_list, true, true));
+    cmds.push_back(Cmd("list", { "ls" }, command_list, help_list, true, true));
     cmds.push_back(Cmd("create", command_create, help_create, false, true));
     cmds.push_back(Cmd("modify", command_modify, help_modify, false, true));
-    cmds.push_back(Cmd("delete", command_delete, help_delete, false, true));
+    cmds.push_back(Cmd("delete", { "remove", "rm" }, command_delete, help_delete, false, true));
     cmds.push_back(Cmd("mount", command_mount, help_mount, true, true));
     cmds.push_back(Cmd("umount", command_umount, help_umount, true, true));
     cmds.push_back(Cmd("status", command_status, help_status, false, true));
@@ -1580,7 +1587,7 @@ main(int argc, char** argv)
     const char* command = getopts.popArg();
 
     list<Cmd>::const_iterator cmd = cmds.begin();
-    while (cmd != cmds.end() && cmd->name != command)
+    while (cmd != cmds.end() && (cmd->name != command && !contains(cmd->aliases, command)))
        ++cmd;
 
     if (cmd == cmds.end())
index 632b6c403477c440fef042403e0fd6bfc6459565..45a09168854078bc4733586492948f1058fec898 100644 (file)
       </varlistentry>
 
       <varlistentry>
-       <term><option>list [options]</option></term>
+       <term><option>list (ls) [options]</option></term>
        <listitem>
          <para>List snapshots.</para>
          <variablelist>
       </varlistentry>
 
       <varlistentry>
-       <term><option>delete <replaceable>number</replaceable> | <replaceable>number1-number2</replaceable></option></term>
+       <term><option>delete (remove|rm) <replaceable>number</replaceable> |
+       <replaceable>number1-number2</replaceable></option></term>
        <listitem>
          <para>Delete a snapshot or a range of snapshots.</para>
        </listitem>
index 9fb3683b0041f9d05c2704db8d79894aeaf0700f..eb3d1d76ae4dc4f326699bff51d3c1406d4a6ba3 100644 (file)
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Mon Jun 02 14:54:29 CEST 2014 - aschnell@suse.de
+
+- added aliases for some snapper commands
+
 -------------------------------------------------------------------
 Tue May 27 11:36:21 CEST 2014 - aschnell@suse.de