From: Guillem Jover Date: Sat, 24 May 2008 06:12:43 +0000 (+0300) Subject: Coalesce similar badusage() strings for translation X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26fb964cd47443e089b97a318aef684bca0d9892;p=dpkg Coalesce similar badusage() strings for translation --- diff --git a/ChangeLog b/ChangeLog index c0927510..7e08b107 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-05-24 Guillem Jover + + * dpkg-deb/build.c (do_build): Move argument name into a parameter to + coalesce similar strings for translation. + * dpkg-split/info.c (do_info): Likewise. + * dpkg-split/join.c (do_join): Likewise. + * dpkg-split/queue.c (do_queue): Likewise. + * src/enquiry.c (audit, unpackchk, assertversion, predeppackage) + (printarch): Likewise. + * src/select.c (setselections, clearselections): Likewise. + 2008-05-24 Guillem Jover * dpkg-deb/main.c: Include . diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c index 8e854b2f..d01856c5 100644 --- a/dpkg-deb/build.c +++ b/dpkg-deb/build.c @@ -189,7 +189,9 @@ void do_build(const char *const *argv) { struct _finfo *symlist_end = NULL; /* Decode our arguments */ - directory= *argv++; if (!directory) badusage(_("--build needs a directory argument")); + directory = *argv++; + if (!directory) + badusage(_("--%s needs a argument"), cipaction->olong); /* template for our tempfiles */ if ((envbuf= getenv("TMPDIR")) == NULL) envbuf= P_tmpdir; diff --git a/dpkg-split/info.c b/dpkg-split/info.c index 3bb9c609..3541f4d9 100644 --- a/dpkg-split/info.c +++ b/dpkg-split/info.c @@ -215,7 +215,9 @@ void do_info(const char *const *argv) { struct partinfo *pi, ps; FILE *part; - if (!*argv) badusage(_("--info requires one or more part file arguments")); + if (!*argv) + badusage(_("--%s requires one or more part file arguments"), + cipaction->olong); while ((thisarg= *argv++)) { part= fopen(thisarg,"r"); diff --git a/dpkg-split/join.c b/dpkg-split/join.c index 7fd789fc..b4aa8cd4 100644 --- a/dpkg-split/join.c +++ b/dpkg-split/join.c @@ -99,7 +99,9 @@ void do_join(const char *const *argv) { unsigned int i; assert(!queue); - if (!*argv) badusage(_("--join requires one or more part file arguments")); + if (!*argv) + badusage(_("--%s requires one or more part file arguments"), + cipaction->olong); while ((thisarg= *argv++)) { pq= nfmalloc(sizeof(struct partqueue)); diff --git a/dpkg-split/queue.c b/dpkg-split/queue.c index bcf7ffe0..fa0faca4 100644 --- a/dpkg-split/queue.c +++ b/dpkg-split/queue.c @@ -192,7 +192,8 @@ void do_queue(const char *const *argv) { unsigned long bytes; unsigned int i; - if (*argv) badusage(_("--listq does not take any arguments")); + if (*argv) + badusage(_("--%s takes no arguments"), cipaction->olong); scandepot(); head= N_("Junk files left around in the depot directory:\n"); diff --git a/src/enquiry.c b/src/enquiry.c index 1cd7988a..3fa9a589 100644 --- a/src/enquiry.c +++ b/src/enquiry.c @@ -128,7 +128,8 @@ void audit(const char *const *argv) { const struct badstatinfo *bsi; int head; - if (*argv) badusage(_("--audit does not take any arguments")); + if (*argv) + badusage(_("--%s takes no arguments"), cipaction->olong); modstatdb_init(admindir,msdbrw_readonly); @@ -182,7 +183,8 @@ void unpackchk(const char *const *argv) { char buf[20]; int width; - if (*argv) badusage(_("--yet-to-unpack does not take any arguments")); + if (*argv) + badusage(_("--%s takes no arguments"), cipaction->olong); modstatdb_init(admindir,msdbrw_readonly|msdbrw_noavail); @@ -255,7 +257,8 @@ static void assertversion(const char *const *argv, const char *reqversion) { struct pkginfo *pkg; - if (*argv) badusage(_("--assert-* does not take any arguments")); + if (*argv) + badusage(_("--%s takes no arguments"), cipaction->olong); modstatdb_init(admindir,msdbrw_readonly|msdbrw_noavail); if (verrev_buf->epoch == ~0UL) { @@ -319,7 +322,8 @@ void predeppackage(const char *const *argv) { struct dependency *dep; struct deppossi *possi, *provider; - if (*argv) badusage(_("--predep-package does not take any argument")); + if (*argv) + badusage(_("--%s takes no arguments"), cipaction->olong); modstatdb_init(admindir,msdbrw_readonly); clear_istobes(); /* We use clientdata->istobe to detect loops */ @@ -391,7 +395,8 @@ void predeppackage(const char *const *argv) { } void printarch(const char *const *argv) { - if (*argv) badusage(_("--print-architecture does not take any argument")); + if (*argv) + badusage(_("--%s takes no arguments"), cipaction->olong); if (printf("%s\n",architecture) == EOF) werr("stdout"); if (fflush(stdout)) werr("stdout"); diff --git a/src/select.c b/src/select.c index 6887e1b6..b7440825 100644 --- a/src/select.c +++ b/src/select.c @@ -92,7 +92,8 @@ void setselections(const char *const *argv) { struct varbuf namevb; struct varbuf selvb; - if (*argv) badusage(_("--set-selections does not take any argument")); + if (*argv) + badusage(_("--%s takes no arguments"), cipaction->olong); modstatdb_init(admindir,msdbrw_write); @@ -151,7 +152,7 @@ void clearselections(const char *const *argv) struct pkginfo *pkg; if (*argv) - badusage(_("--clear-selections does not take any argument")); + badusage(_("--%s takes no arguments"), cipaction->olong); modstatdb_init(admindir, msdbrw_write);