Просмотр исходного кода

dselect: Improve commands listing in --help output

Print them before options and list them one on each line with a
description.
Guillem Jover лет назад: 11
Родитель
Сommit
99bc249f9f
2 измененных файлов с 7 добавлено и 4 удалено
  1. 2 0
      debian/changelog
  2. 5 4
      dselect/main.cc

+ 2 - 0
debian/changelog

@@ -111,6 +111,8 @@ dpkg (1.18.0) UNRELEASED; urgency=low
   * Normalize dpkg-parsechangelog command-line parsing, so that «-ovalue»,
     «-o value», «--option=value» and «--option value» will all be accepted.
     Closes: #693951
+  * Improve commands listing in «dselect --help» output, by printing them
+    before options and listing them one on each line with a description.
 
   [ Raphaël Hertzog ]
   * Drop myself from Uploaders.

+ 5 - 4
dselect/main.cc

@@ -180,6 +180,11 @@ usage(const struct cmdinfo *ci, const char *value)
 "Usage: %s [<option>...] [<command>...]\n"
 "\n"), DSELECT);
 
+  printf(_("Commands:\n"));
+  for (i = 0; menuentries[i].command; i++)
+    printf("  %-10s  %s\n", menuentries[i].command, menuentries[i].menuent);
+  fputs("\n", stdout);
+
   printf(_(
 "Options:\n"
 "  --admindir <directory>     Use <directory> instead of %s.\n"
@@ -194,10 +199,6 @@ usage(const struct cmdinfo *ci, const char *value)
 "  --version                  Show the version.\n"
 "\n"));
 
-  printf(_("Commands:\n"));
-  for (i = 0; menuentries[i].command; i++)
-    printf("  %s", menuentries[i].command);
-  fputs("\n\n", stdout);
 
   printf(_("Screenparts:\n"));
   for (i=0; screenparttable[i].name; i++)