Change the syntax of the parameters to the touch command.
authorAndre Noll <maan@systemlinux.org>
Sat, 4 Jul 2009 16:29:31 +0000 (18:29 +0200)
committerAndre Noll <maan@systemlinux.org>
Sat, 4 Jul 2009 16:29:31 +0000 (18:29 +0200)
It's more natural to specify e.g. the numplayed count as

touch -n=42

rather than

touch -n42

afs.cmd
aft.c

diff --git a/afs.cmd b/afs.cmd
index c55dfe7..de9782a 100644 (file)
--- a/afs.cmd
+++ b/afs.cmd
@@ -187,7 +187,7 @@ H:  a slash (see fnmatch(3)).
 N: touch
 P: AFS_READ | AFS_WRITE
 D: Manipulate the afs data for all audio files matching a pattern.
-U: touch [-n numplayed] [-l lastplayed] [-y lyrics_id] [-i image_id] [-a amp] [-v] [-p] pattern
+U: touch [-n=numplayed] [-l=lastplayed] [-y=lyrics_id] [-i=image_id] [-a=amp] [-v] [-p] pattern
 H: If no option is given, lastplayed is set to the current time
 H: and numplayed is increased by one. Otherwise, only the given
 H: options are taken into account.
diff --git a/aft.c b/aft.c
index daa9a50..6b74b0a 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -2105,33 +2105,33 @@ int com_touch(struct rc4_context *rc4c, int argc, char * const * const argv)
                        i++;
                        break;
                }
-               if (!strncmp(arg, "-n", 2)) {
-                       ret = para_atoi32(arg + 2, &cto.num_played);
+               if (!strncmp(arg, "-n=", 3)) {
+                       ret = para_atoi32(arg + 3, &cto.num_played);
                        if (ret < 0)
                                return ret;
                        continue;
                }
-               if (!strncmp(arg, "-l", 2)) {
-                       ret = para_atoi64(arg + 2, &cto.last_played);
+               if (!strncmp(arg, "-l=", 3)) {
+                       ret = para_atoi64(arg + 3, &cto.last_played);
                        if (ret < 0)
                                return ret;
                        continue;
                }
-               if (!strncmp(arg, "-y", 2)) {
-                       ret = para_atoi32(arg + 2, &cto.lyrics_id);
+               if (!strncmp(arg, "-y=", 3)) {
+                       ret = para_atoi32(arg + 3, &cto.lyrics_id);
                        if (ret < 0)
                                return ret;
                        continue;
                }
-               if (!strncmp(arg, "-i", 2)) {
-                       ret = para_atoi32(arg + 2, &cto.image_id);
+               if (!strncmp(arg, "-i=", 3)) {
+                       ret = para_atoi32(arg + 3, &cto.image_id);
                        if (ret < 0)
                                return ret;
                        continue;
                }
-               if (!strncmp(arg, "-a", 2)) {
+               if (!strncmp(arg, "-a=", 3)) {
                        int32_t val;
-                       ret = para_atoi32(arg + 2, &val);
+                       ret = para_atoi32(arg + 3, &val);
                        if (ret < 0)
                                return ret;
                        if (val < 0 || val > 255)