diff options
author | Guillem Jover <guillem@debian.org> | 2006-05-23 04:12:01 +0000 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2006-05-23 04:12:01 +0000 |
commit | 5ed5d7e068e7668babbdfc4fc54df71032446d76 (patch) | |
tree | f32e56564c0247714704d56c4aeb4d5ff2981330 /scripts/dpkg-distaddfile.pl | |
parent | 10843681279306752fb0a7a7f0553ef5e0d9ea76 (diff) | |
download | dpkg-5ed5d7e068e7668babbdfc4fc54df71032446d76.tar.gz |
Standarize scripts usage output format and at the same time make
the strings easier for the translators. Add '--help' and '--version'
for most of the scripts. Print the usage and version to stdout.
Diffstat (limited to 'scripts/dpkg-distaddfile.pl')
-rwxr-xr-x | scripts/dpkg-distaddfile.pl | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/scripts/dpkg-distaddfile.pl b/scripts/dpkg-distaddfile.pl index 1bb695758..cd82b8b5d 100755 --- a/scripts/dpkg-distaddfile.pl +++ b/scripts/dpkg-distaddfile.pl @@ -14,25 +14,37 @@ require 'controllib.pl'; require 'dpkg-gettext.pl'; textdomain("dpkg-dev"); -sub usageversion { - printf STDERR _g( -"Debian dpkg-distaddfile %s. Copyright (C) 1996 -Ian Jackson. This is free software; see the GNU General Public Licence -version 2 or later for copying conditions. There is NO warranty. +sub version { + printf _g("Debian %s version %s.\n"), $progname, $version; -Usage: - dpkg-distaddfile <filename> <section> <priority> -Options: -f<fileslistfile> write files here instead of debian/files - -h print this message -"), $version; + printf _g(" +Copyright (C) 1996 Ian Jackson."); + + printf _g(" +This is free software; see the GNU General Public Licence version 2 or +later for copying conditions. There is NO warranty. +"); +} + +sub usage { + printf _g( +"Usage: %s [<option>...] <filename> <section> <priority> + +Options: + -f<fileslistfile> write files here instead of debian/files. + -h, --help show this help message. + --version show the version. +"), $progname; } while (@ARGV && $ARGV[0] =~ m/^-/) { $_=shift(@ARGV); if (m/^-f/) { $fileslistfile= $'; - } elsif (m/^-h$/) { - &usageversion; exit(0); + } elsif (m/^-(h|-help)$/) { + &usage; exit(0); + } elsif (m/^--version$/) { + &version; exit(0); } elsif (m/^--$/) { last; } else { |