summaryrefslogtreecommitdiff
path: root/dpkg-deb
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2012-03-14 06:02:13 +0100
committerGuillem Jover <guillem@debian.org>2012-03-14 06:30:43 +0100
commitff5ac5ced01817f584126fc157b07d3131b205c5 (patch)
treef2f38c1d50568fe2171082f39b25f0976a4e5dd3 /dpkg-deb
parent977cb99bfdfad7195e8fb58d65d86f59858de795 (diff)
downloaddpkg-ff5ac5ced01817f584126fc157b07d3131b205c5.tar.gz
Rework common badusage strings to allow for possible translation reuse
Use cmdinfo long name instead of hard-coding it in the literal string, and reword some strings to make them more generally usable.
Diffstat (limited to 'dpkg-deb')
-rw-r--r--dpkg-deb/build.c3
-rw-r--r--dpkg-deb/info.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
index b5802cdb4..60f0ddb82 100644
--- a/dpkg-deb/build.c
+++ b/dpkg-deb/build.c
@@ -406,7 +406,8 @@ do_build(const char *const *argv)
if (debar != NULL) {
struct stat debarstab;
- if (*argv) badusage(_("--build takes at most two arguments"));
+ if (*argv)
+ badusage(_("--%s takes at most two arguments"), cipaction->olong);
if (stat(debar, &debarstab)) {
if (errno != ENOENT)
diff --git a/dpkg-deb/info.c b/dpkg-deb/info.c
index d7dfeb5b1..5c1a1531f 100644
--- a/dpkg-deb/info.c
+++ b/dpkg-deb/info.c
@@ -323,9 +323,10 @@ do_field(const char *const *argv)
int
do_contents(const char *const *argv)
{
- const char *debar;
+ const char *debar = *argv++;
- if (!(debar= *argv++) || *argv) badusage(_("--contents takes exactly one argument"));
+ if (debar == NULL || *argv)
+ badusage(_("--%s takes exactly one argument"), cipaction->olong);
extracthalf(debar, NULL, "tv", 0);
return 0;