From: Andre Noll Date: Sat, 4 Jul 2009 16:29:31 +0000 (+0200) Subject: Change the syntax of the parameters to the touch command. X-Git-Tag: v0.4.0~73 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=c5377b01db238eba1a50f2b065cd19eb02145450 Change the syntax of the parameters to the touch command. It's more natural to specify e.g. the numplayed count as touch -n=42 rather than touch -n42 --- diff --git a/afs.cmd b/afs.cmd index c55dfe71..de9782a3 100644 --- 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 daa9a500..6b74b0ae 100644 --- 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)