Package: file
Version: 4.26-2
Severity: wishlist

In the world of software, programs are written without any contact
between various authors. It would help if programs could in some
extent unify the UI, so that options would be closely the same. I
believe -v is more used as synonym for --verbose. This is based on
observations of the most commonly used command line programs, in daily
basis: e.g. the GNU commands (cp -v, mv -m ...) and ssh(1).

>From user perspective, unifying the command line options would be a good
thing, thus I propose changing -v option to uppercase -V [1].

The patch is based on the 5.00 sources at
ftp://ftp.astron.com/pub/file/

Jari

[1] See also
http://www.gnu.org/prep/standards/standards.html#Command_002dLine-Interfaces

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages file depends on:
ii  libc6                  2.9-4             GNU C Library: Shared libraries
ii  libmagic1              4.26-2            File type determination library us
ii  zlib1g                 1:1.2.3.3.dfsg-12 compression library - runtime

file recommends no packages.

file suggests no packages.

-- no debconf information
>From 353163e8fe64d56eca3629c875148d61cffe907c Mon Sep 17 00:00:00 2001
From: Jari Aalto <[email protected]>
Date: Fri, 20 Mar 2009 20:49:39 +0200
Subject: [PATCH] doc/file.man, src/file.c, src/file_opts.h: Change short option 
v to V for (--version)

Signed-off-by: Jari Aalto <[email protected]>
---
 doc/file.man    |    2 +-
 src/file.c      |    6 +++---
 src/file_opts.h |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/file.man b/doc/file.man
index 1215e69..9381afe 100644
--- a/doc/file.man
+++ b/doc/file.man
@@ -293,7 +293,7 @@ This option also causes
 to disregard the file size as reported by
 .Xr stat 2
 since on some systems it reports a zero size for raw disk partitions.
-.It Fl v , -version
+.It Fl V , -Version
 Print the version of the program and exit.
 .It Fl z , -uncompress
 Try to look inside compressed files.
diff --git a/src/file.c b/src/file.c
index 9b4747b..0990cde 100644
--- a/src/file.c
+++ b/src/file.c
@@ -80,7 +80,7 @@ int getopt_long(int argc, char * const *argv, const char 
*optstring, const struc
 #define SYMLINKFLAG ""
 #endif
 
-# define USAGE  "Usage: %s [-bcik" SYMLINKFLAG "nNrsvz0] [-e test] [-f 
namefile] [-F separator] [-m magicfiles] file...\n       %s -C -m magicfiles\n"
+# define USAGE  "Usage: %s [-bcik" SYMLINKFLAG "nNrsVz0] [-e test] [-f 
namefile] [-F separator] [-m magicfiles] file...\n       %s -C -m magicfiles\n"
 
 #ifndef MAXPATHLEN
 #define        MAXPATHLEN      1024
@@ -105,7 +105,7 @@ private const struct option long_options[] = {
 #undef OPT_LONGONLY
     {0, 0, NULL, 0}
 };
-#define OPTSTRING      "bcCde:f:F:hikLm:nNprsvz0"
+#define OPTSTRING      "bcCde:f:F:hikLm:nNprsVz0"
 
 private const struct {
        const char *name;
@@ -262,7 +262,7 @@ main(int argc, char *argv[])
                case 's':
                        flags |= MAGIC_DEVICES;
                        break;
-               case 'v':
+               case 'V':
                        (void)fprintf(stderr, "%s-%d.%.2d\n", progname,
                                       FILE_VERSION_MAJOR, patchlevel);
                        (void)fprintf(stderr, "magic file from %s\n",
diff --git a/src/file_opts.h b/src/file_opts.h
index 1a73e87..9c86d3b 100644
--- a/src/file_opts.h
+++ b/src/file_opts.h
@@ -13,7 +13,7 @@
  */
 
 OPT_LONGONLY("help", 0, "                 display this help and exit\n")
-OPT('v', "version", 0, "              output version information and exit\n")
+OPT('V', "version", 0, "              output version information and exit\n")
 OPT('m', "magic-file", 1, " LIST      use LIST as a colon-separated list of 
magic\n"
     "                               number files\n")
 OPT('z', "uncompress", 0, "           try to look inside compressed files\n")
-- 
1.6.1.3

Reply via email to