소스 검색

Coalesce similar badusage() strings for translation

Guillem Jover 18 년 전
부모
커밋
26fb964cd4
7개의 변경된 파일35개의 추가작업 그리고 11개의 파일을 삭제
  1. 11 0
      ChangeLog
  2. 3 1
      dpkg-deb/build.c
  3. 3 1
      dpkg-split/info.c
  4. 3 1
      dpkg-split/join.c
  5. 2 1
      dpkg-split/queue.c
  6. 10 5
      src/enquiry.c
  7. 3 2
      src/select.c

+ 11 - 0
ChangeLog

@@ -1,3 +1,14 @@
+2008-05-24  Guillem Jover  <guillem@debian.org>
+
+	* 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  <guillem@debian.org>
 
 	* dpkg-deb/main.c: Include <dpkg-priv.h>.

+ 3 - 1
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 <directory> argument"), cipaction->olong);
   /* template for our tempfiles */
   if ((envbuf= getenv("TMPDIR")) == NULL)
     envbuf= P_tmpdir;

+ 3 - 1
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");

+ 3 - 1
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));
 

+ 2 - 1
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");

+ 10 - 5
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");

+ 3 - 2
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);