]> git.ipfire.org Git - thirdparty/pciutils.git/commitdiff
Tidy up help texts on usage.
authorMartin Mares <mj@ucw.cz>
Tue, 12 Feb 2008 09:48:27 +0000 (10:48 +0100)
committerMartin Mares <mj@ucw.cz>
Tue, 12 Feb 2008 09:48:27 +0000 (10:48 +0100)
lspci.c
pciutils.h
setpci.c

diff --git a/lspci.c b/lspci.c
index 7879f9b88c51fa3ff0a897a395ada2cba56dcc4a..0515fcd6ad8d89c64bcc54fdf5d61da73163285b 100644 (file)
--- a/lspci.c
+++ b/lspci.c
@@ -12,6 +12,7 @@
 #include <stdarg.h>
 #include <unistd.h>
 
+#define PCIUTILS_LSPCI
 #include "pciutils.h"
 
 /* Options */
@@ -36,7 +37,22 @@ static char options[] = "nvbxs:d:ti:mgp:qkMDQ" GENERIC_OPTIONS ;
 static char help_msg[] =
 "Usage: lspci [<switches>]\n"
 "\n"
-"-v\t\tBe verbose\n"
+"Basic display modes:\n"
+"-mm\t\tProduce machine-readable output (single -m for an obsolete format)\n"
+"-t\t\tShow bus tree\n"
+"\n"
+"Display options:\n"
+"-v\t\tBe verbose (-vv for very verbose)\n"
+#ifdef PCI_OS_LINUX
+"-k\t\tShow kernel drivers handling each device\n"
+#endif
+"-x\t\tShow hex-dump of the standard part of the config space\n"
+"-xxx\t\tShow hex-dump of the whole config space (dangerous; root only)\n"
+"-xxxx\t\tShow hex-dump of the 4096-byte extended config space (root only)\n"
+"-b\t\tBus-centric view (addresses and IRQ's as seen by the bus)\n"
+"-D\t\tAlways show domain numbers\n"
+"\n"
+"Resolving of device ID's to names:\n"
 "-n\t\tShow numeric ID's\n"
 "-nn\t\tShow both textual and numeric ID's (names & numbers)\n"
 #ifdef PCI_USE_DNS
@@ -44,21 +60,19 @@ static char help_msg[] =
 "-qq\t\tAs above, but re-query locally cached entries\n"
 "-Q\t\tQuery the PCI ID database for all ID's via DNS\n"
 #endif
-"-b\t\tBus-centric view (PCI addresses and IRQ's instead of those seen by the CPU)\n"
-"-x\t\tShow hex-dump of the standard portion of config space\n"
-"-xxx\t\tShow hex-dump of the whole config space (dangerous; root only)\n"
-"-xxxx\t\tShow hex-dump of the 4096-byte extended config space (root only)\n"
+"\n"
+"Selection of devices:\n"
 "-s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]\tShow only devices in selected slots\n"
-"-d [<vendor>]:[<device>]\tShow only selected devices\n"
-"-t\t\tShow bus tree\n"
-"-m\t\tProduce machine-readable output\n"
+"-d [<vendor>]:[<device>]\t\t\tShow only devices with specified ID's\n"
+"\n"
+"Other options:\n"
 "-i <file>\tUse specified ID database instead of %s\n"
 #ifdef PCI_OS_LINUX
-"-k\t\tShow kernel drivers handling each device\n"
 "-p <file>\tLook up kernel modules in a given file instead of default modules.pcimap\n"
 #endif
-"-D\t\tAlways show domain numbers\n"
 "-M\t\tEnable `bus mapping' mode (dangerous; root only)\n"
+"\n"
+"PCI access options:\n"
 GENERIC_HELP
 ;
 
@@ -2727,9 +2741,11 @@ main(int argc, char **argv)
       case 'p':
        opt_pcimap = optarg;
        break;
+#ifdef PCI_OS_LINUX
       case 'k':
        opt_kernel++;
        break;
+#endif
       case 'M':
        opt_map_mode++;
        break;
index 21d46c13896cda0b03f158525bf0562f88a32a36..67b586fb57154831c25a6a2594c0636553f06923 100644 (file)
@@ -29,16 +29,17 @@ int parse_generic_option(int i, struct pci_access *pacc, char *optarg);
 #define GENOPT_INTEL
 #define GENHELP_INTEL
 #endif
-#ifdef PCI_HAVE_PM_DUMP
+#if defined(PCI_HAVE_PM_DUMP) && !defined(PCIUTILS_SETPCI)
 #define GENOPT_DUMP "F:"
-#define GENHELP_DUMP "-F <file>\tRead configuration data from given file\n"
+#define GENHELP_DUMP "-F <file>\tRead PCI configuration dump from a given file\n"
 #else
 #define GENOPT_DUMP
 #define GENHELP_DUMP
 #endif
 
 #define GENERIC_OPTIONS "A:GO:" GENOPT_INTEL GENOPT_DUMP
-#define GENERIC_HELP GENHELP_INTEL GENHELP_DUMP \
+#define GENERIC_HELP \
        "-A <method>\tUse the specified PCI access method (see `-A help' for a list)\n" \
+       "-O <par>=<val>\tSet PCI access parameter (see `-O help' for a list)\n" \
        "-G\t\tEnable PCI access debugging\n" \
-       "-O <par>=<val>\tSet PCI access parameter (see `-O help' for a list)\n"
+       GENHELP_INTEL GENHELP_DUMP
index 7ed0ac6c46b82a3ab0f11d37477ab48ab6a3d41b..3ebbaeedeaed127bcb78fdd22bb1a81e726db000 100644 (file)
--- a/setpci.c
+++ b/setpci.c
@@ -1,7 +1,7 @@
 /*
  *     The PCI Utilities -- Manipulate PCI Configuration Registers
  *
- *     Copyright (c) 1998--2006 Martin Mares <mj@ucw.cz>
+ *     Copyright (c) 1998--2008 Martin Mares <mj@ucw.cz>
  *
  *     Can be freely distributed and used under the terms of the GNU GPL.
  */
@@ -12,6 +12,7 @@
 #include <stdarg.h>
 #include <unistd.h>
 
+#define PCIUTILS_SETPCI
 #include "pciutils.h"
 
 static int force;                      /* Don't complain if no devices match */
@@ -259,10 +260,16 @@ usage(char *msg, ...)
     }
   fprintf(stderr,
 "Usage: setpci [<options>] (<device>+ <reg>[=<values>]*)*\n"
+"\n"
+"General options:\n"
 "-f\t\tDon't complain if there's nothing to do\n"
 "-v\t\tBe verbose\n"
 "-D\t\tList changes, don't commit them\n"
+"\n"
+"PCI access options:\n"
 GENERIC_HELP
+"\n"
+"Setting commands:\n"
 "<device>:\t-s [[[<domain>]:][<bus>]:][<slot>][.[<func>]]\n"
 "\t|\t-d [<vendor>]:[<device>]\n"
 "<reg>:\t\t<number>[.(B|W|L)]\n"