move help text from include/usage.src.h to console-tools/*.c
authorPere Orga <gotrunks@gmail.com>
Sun, 27 Mar 2011 21:42:28 +0000 (23:42 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 28 Mar 2011 00:51:01 +0000 (02:51 +0200)
Signed-off-by: Pere Orga <gotrunks@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
16 files changed:
console-tools/chvt.c
console-tools/clear.c
console-tools/deallocvt.c
console-tools/dumpkmap.c
console-tools/fgconsole.c
console-tools/kbd_mode.c
console-tools/loadfont.c
console-tools/loadkmap.c
console-tools/openvt.c
console-tools/reset.c
console-tools/resize.c
console-tools/setconsole.c
console-tools/setkeycodes.c
console-tools/setlogcons.c
console-tools/showkey.c
include/usage.src.h

index 07e58c3b8ab13bc9938746cb1e38ce890e30b0c6..b9c974f4a49e9f29b1d7ad3fbc355b24f4b72858 100644 (file)
@@ -6,6 +6,12 @@
  *
  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
+
+//usage:#define chvt_trivial_usage
+//usage:       "N"
+//usage:#define chvt_full_usage "\n\n"
+//usage:       "Change the foreground virtual terminal to /dev/ttyN"
+
 #include "libbb.h"
 
 int chvt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
index dcb9bfb02a875d48ddca210511fb96088675480a..ac22b787e84e829a183d83ba3f677f5534cf8d3f 100644 (file)
@@ -6,6 +6,12 @@
  *
  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
+
+//usage:#define clear_trivial_usage
+//usage:       ""
+//usage:#define clear_full_usage "\n\n"
+//usage:       "Clear screen"
+
 #include "libbb.h"
 
 int clear_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
index 6a1d13d149e3496e18ccb1aad248922afb8330f2..b131c0a64985e61adc42948b0a65d527b8655f0c 100644 (file)
 
 /* no options, no getopt */
 
+//usage:#define deallocvt_trivial_usage
+//usage:       "[N]"
+//usage:#define deallocvt_full_usage "\n\n"
+//usage:       "Deallocate unused virtual terminal /dev/ttyN"
+
 #include "libbb.h"
 
 /* From <linux/vt.h> */
index 301a90674a71cff51d23f8c2e546da66ab5d85a4..6b923d2d47bd4f9bd8d2152fe12f31f1eaa8ed3d 100644 (file)
@@ -9,6 +9,14 @@
  */
 /* no options, no getopt */
 
+//usage:#define dumpkmap_trivial_usage
+//usage:       "> keymap"
+//usage:#define dumpkmap_full_usage "\n\n"
+//usage:       "Print a binary keyboard translation table to stdout"
+//usage:
+//usage:#define dumpkmap_example_usage
+//usage:       "$ dumpkmap > keymap\n"
+
 #include "libbb.h"
 
 /* From <linux/kd.h> */
index e2dba4860a3725a6bf9313b814c1c32db275d2c4..54355bee61f94cffe14a75f71130eb65b879d8a9 100644 (file)
@@ -7,6 +7,11 @@
  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
+//usage:#define fgconsole_trivial_usage
+//usage:       ""
+//usage:#define fgconsole_full_usage "\n\n"
+//usage:       "Get active console"
+
 #include "libbb.h"
 
 /* From <linux/vt.h> */
index 1481d0dbb193a6cfed2212a95bc41c60c1f4e493..221a9f7829b0f583d1e62ef7d2c58517e3456e2a 100644 (file)
@@ -8,6 +8,18 @@
  *
  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
+
+//usage:#define kbd_mode_trivial_usage
+//usage:       "[-a|k|s|u] [-C TTY]"
+//usage:#define kbd_mode_full_usage "\n\n"
+//usage:       "Report or set the keyboard mode\n"
+//usage:     "\nOptions:"
+//usage:     "\n       -a      Default (ASCII)"
+//usage:     "\n       -k      Medium-raw (keyboard)"
+//usage:     "\n       -s      Raw (scancode)"
+//usage:     "\n       -u      Unicode (utf-8)"
+//usage:     "\n       -C TTY  Affect TTY instead of /dev/tty"
+
 #include "libbb.h"
 #include <linux/kd.h>
 
index 079626c20b360bb91eb5278c7a5d859a453fa3a5..588322b0561e5ac9093c59cd573878b0e8db80ce 100644 (file)
@@ -9,6 +9,16 @@
  *
  * Licensed under GPLv2, see file LICENSE in this source tree.
  */
+
+//usage:#define loadfont_trivial_usage
+//usage:       "< font"
+//usage:#define loadfont_full_usage "\n\n"
+//usage:       "Load a console font from stdin"
+/* //usage:     "\n    -C TTY  Affect TTY instead of /dev/tty" */
+//usage:
+//usage:#define loadfont_example_usage
+//usage:       "$ loadfont < /etc/i18n/fontname\n"
+
 #include "libbb.h"
 #include <sys/kd.h>
 
index 2d1c9e2848178d9e4257c524e57c8355de7f1da2..bcffe16b123815b3768658cc0920d7d5d3237199 100644 (file)
@@ -6,6 +6,16 @@
  *
  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
+
+//usage:#define loadkmap_trivial_usage
+//usage:       "< keymap"
+//usage:#define loadkmap_full_usage "\n\n"
+//usage:       "Load a binary keyboard translation table from stdin\n"
+/* //usage:     "\n    -C TTY  Affect TTY instead of /dev/tty" */
+//usage:
+//usage:#define loadkmap_example_usage
+//usage:       "$ loadkmap < /etc/i18n/lang-keymap\n"
+
 #include "libbb.h"
 
 #define BINARY_KEYMAP_MAGIC "bkeymap"
index 56f50c6cd49933ed85c1e352c4530700ef70d710..de5cf93fe85c75e54dd76db0e11d01a5346cd57c 100644 (file)
@@ -8,6 +8,19 @@
  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
+//usage:#define openvt_trivial_usage
+//usage:       "[-c N] [-sw] [PROG ARGS]"
+//usage:#define openvt_full_usage "\n\n"
+//usage:       "Start PROG on a new virtual terminal\n"
+//usage:     "\nOptions:"
+//usage:     "\n       -c N    Use specified VT"
+//usage:     "\n       -s      Switch to the VT"
+/* //usage:     "\n    -l      Run PROG as login shell (by prepending '-')" */
+//usage:     "\n       -w      Wait for PROG to exit"
+//usage:
+//usage:#define openvt_example_usage
+//usage:       "openvt 2 /bin/ash\n"
+
 #include <linux/vt.h>
 #include "libbb.h"
 
index a23e4f4085d59765ba6d473667ead95c4c02605d..65940bdec5db4ecfbe268b110c422c6d1c085c8c 100644 (file)
 /* BTW, which "standard" package has this utility? It doesn't seem
  * to be ncurses, coreutils, console-tools... then what? */
 
+//usage:#define reset_trivial_usage
+//usage:       ""
+//usage:#define reset_full_usage "\n\n"
+//usage:       "Reset the screen"
+
 #include "libbb.h"
 
 #define ESC "\033"
index ee0728b713706bdc3ad183704cc33d7622db3958..4b0d63a03c8086a802e8d889aeeeb38b549f601f 100644 (file)
@@ -7,6 +7,12 @@
  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 /* no options, no getopt */
+
+//usage:#define resize_trivial_usage
+//usage:       ""
+//usage:#define resize_full_usage "\n\n"
+//usage:       "Resize the screen"
+
 #include "libbb.h"
 
 #define ESC "\033"
index 87265baf8e65219b6fa08bfffda4aa94815d7501..59c83361cc6d43394585afe1344166b1fb106d24 100644 (file)
@@ -8,6 +8,13 @@
  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
+//usage:#define setconsole_trivial_usage
+//usage:       "[-r" IF_FEATURE_SETCONSOLE_LONG_OPTIONS("|--reset") "] [DEVICE]"
+//usage:#define setconsole_full_usage "\n\n"
+//usage:       "Redirect system console output to DEVICE (default: /dev/tty)\n"
+//usage:     "\nOptions:"
+//usage:     "\n       -r      Reset output to /dev/console"
+
 #include "libbb.h"
 
 int setconsole_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
index ca8cd21c2a92c66360fbc2d03866ae830d23e99d..a6a7c237438b89d6722e73e32e1ff6daf41a9205 100644 (file)
@@ -8,6 +8,18 @@
  *
  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
+
+//usage:#define setkeycodes_trivial_usage
+//usage:       "SCANCODE KEYCODE..."
+//usage:#define setkeycodes_full_usage "\n\n"
+//usage:       "Set entries into the kernel's scancode-to-keycode map,\n"
+//usage:       "allowing unusual keyboards to generate usable keycodes.\n\n"
+//usage:       "SCANCODE may be either xx or e0xx (hexadecimal),\n"
+//usage:       "and KEYCODE is given in decimal."
+//usage:
+//usage:#define setkeycodes_example_usage
+//usage:       "$ setkeycodes e030 127\n"
+
 #include "libbb.h"
 
 /* From <linux/kd.h> */
index 52d2608aa7cef36b59760c196f376b121952be33..83a895407b719ae726d5f950dd9ad331d46e834a 100644 (file)
@@ -9,6 +9,11 @@
  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
+//usage:#define setlogcons_trivial_usage
+//usage:       "N"
+//usage:#define setlogcons_full_usage "\n\n"
+//usage:       "Redirect the kernel output to console N (0 for current)"
+
 #include "libbb.h"
 
 int setlogcons_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
index 06df68bfde0adc4feb898b21a209c49d6d782677..2c832c92c337f3f93bdbca7bdd960d9add131d72 100644 (file)
@@ -7,6 +7,15 @@
  * Licensed under GPLv2, see file LICENSE in this source tree.
  */
 
+//usage:#define showkey_trivial_usage
+//usage:       "[-a | -k | -s]"
+//usage:#define showkey_full_usage "\n\n"
+//usage:       "Show keys pressed\n"
+//usage:     "\nOptions:"
+//usage:     "\n       -a      Display decimal/octal/hex values of the keys"
+//usage:     "\n       -k      Display interpreted keycodes (default)"
+//usage:     "\n       -s      Display raw scan-codes"
+
 #include "libbb.h"
 #include <linux/kd.h>
 
index 69b8da27275588aa8b649b0c92ccfa1fdf13c69f..c1720b5f10be06570a69b91b0513f140d966d9c1 100644 (file)
@@ -403,21 +403,11 @@ INSERT
        "# ls -l /bin/ls\n" \
        "-rwxr-xr-x    1 root     root        40816 Feb  5 07:45 /bin/ls*\n"
 
-#define chvt_trivial_usage \
-       "N"
-#define chvt_full_usage "\n\n" \
-       "Change the foreground virtual terminal to /dev/ttyN"
-
 #define cksum_trivial_usage \
        "FILES..."
 #define cksum_full_usage "\n\n" \
        "Calculate the CRC32 checksums of FILES"
 
-#define clear_trivial_usage \
-       ""
-#define clear_full_usage "\n\n" \
-       "Clear screen"
-
 #define cmp_trivial_usage \
        "[-l] [-s] FILE1 [FILE2" IF_DESKTOP(" [SKIP1 [SKIP2]]") "]"
 #define cmp_full_usage "\n\n" \
@@ -614,11 +604,6 @@ INSERT
        "4+0 records in\n" \
        "4+0 records out\n"
 
-#define deallocvt_trivial_usage \
-       "[N]"
-#define deallocvt_full_usage "\n\n" \
-       "Deallocate unused virtual terminal /dev/ttyN"
-
 #define delgroup_trivial_usage \
        IF_FEATURE_DEL_USER_FROM_GROUP("[USER] ")"GROUP"
 #define delgroup_full_usage "\n\n" \
@@ -806,13 +791,6 @@ INSERT
        "104     ./docs\n" \
        "2417    .\n"
 
-#define dumpkmap_trivial_usage \
-       "> keymap"
-#define dumpkmap_full_usage "\n\n" \
-       "Print a binary keyboard translation table to stdout"
-#define dumpkmap_example_usage \
-       "$ dumpkmap > keymap\n"
-
 #define dumpleases_trivial_usage \
        "[-r|-a] [-f LEASEFILE]"
 #define dumpleases_full_usage "\n\n" \
@@ -1037,11 +1015,6 @@ INSERT
      "\n       -H HEADS" \
      "\n       -S SECTORS" \
 
-#define fgconsole_trivial_usage \
-       ""
-#define fgconsole_full_usage "\n\n" \
-       "Get active console"
-
 #define findfs_trivial_usage \
        "LABEL=label or UUID=uuid"
 #define findfs_full_usage "\n\n" \
@@ -1712,17 +1685,6 @@ INSERT
        "       [[i|o]seq] [[i|o]key KEY] [[i|o]csum]\n" \
        "       [ttl TTL] [tos TOS] [[no]pmtudisc] [dev PHYS_DEV]" \
 
-#define kbd_mode_trivial_usage \
-       "[-a|k|s|u] [-C TTY]"
-#define kbd_mode_full_usage "\n\n" \
-       "Report or set the keyboard mode\n" \
-     "\nOptions:" \
-     "\n       -a      Default (ASCII)" \
-     "\n       -k      Medium-raw (keyboard)" \
-     "\n       -s      Raw (scancode)" \
-     "\n       -u      Unicode (utf-8)" \
-     "\n       -C TTY  Affect TTY instead of /dev/tty" \
-
 #define kill_trivial_usage \
        "[-l] [-SIG] PID..."
 #define kill_full_usage "\n\n" \
@@ -1822,24 +1784,6 @@ INSERT
 #define load_policy_trivial_usage NOUSAGE_STR
 #define load_policy_full_usage ""
 
-#define loadfont_trivial_usage \
-       "< font"
-#define loadfont_full_usage "\n\n" \
-       "Load a console font from stdin" \
-/*   "\n       -C TTY  Affect TTY instead of /dev/tty" */ \
-
-#define loadfont_example_usage \
-       "$ loadfont < /etc/i18n/fontname\n"
-
-#define loadkmap_trivial_usage \
-       "< keymap"
-#define loadkmap_full_usage "\n\n" \
-       "Load a binary keyboard translation table from stdin\n" \
-/*   "\n       -C TTY  Affect TTY instead of /dev/tty" */ \
-
-#define loadkmap_example_usage \
-       "$ loadkmap < /etc/i18n/lang-keymap\n"
-
 #define logger_trivial_usage \
        "[OPTIONS] [MESSAGE]"
 #define logger_full_usage "\n\n" \
@@ -2405,19 +2349,6 @@ INSERT
        "Write an unambiguous representation, octal bytes by default, of FILE\n" \
        "(or stdin) to stdout"
 
-#define openvt_trivial_usage \
-       "[-c N] [-sw] [PROG ARGS]"
-#define openvt_full_usage "\n\n" \
-       "Start PROG on a new virtual terminal\n" \
-     "\nOptions:" \
-     "\n       -c N    Use specified VT" \
-     "\n       -s      Switch to the VT" \
-/*   "\n       -l      Run PROG as login shell (by prepending '-')" */ \
-     "\n       -w      Wait for PROG to exit" \
-
-#define openvt_example_usage \
-       "openvt 2 /bin/ash\n"
-
 /*
 #define parse_trivial_usage \
        "[-n MAXTOKENS] [-m MINTOKENS] [-d DELIMS] [-f FLAGS] FILE..."
@@ -2704,16 +2635,6 @@ INSERT
 #define scriptreplay_full_usage "\n\n" \
        "Play back typescripts, using timing information"
 
-#define reset_trivial_usage \
-       ""
-#define reset_full_usage "\n\n" \
-       "Reset the screen"
-
-#define resize_trivial_usage \
-       ""
-#define resize_full_usage "\n\n" \
-       "Resize the screen"
-
 #define restorecon_trivial_usage \
        "[-iFnRv] [-e EXCLUDEDIR]... [-o FILE] [-f FILE]"
 #define restorecon_full_usage "\n\n" \
@@ -2926,13 +2847,6 @@ INSERT
        "       -v      Verbose" \
      "\n       -b      Display current state of booleans" \
 
-#define setconsole_trivial_usage \
-       "[-r" IF_FEATURE_SETCONSOLE_LONG_OPTIONS("|--reset") "] [DEVICE]"
-#define setconsole_full_usage "\n\n" \
-       "Redirect system console output to DEVICE (default: /dev/tty)\n" \
-     "\nOptions:" \
-     "\n       -r      Reset output to /dev/console" \
-
 #define setenforce_trivial_usage \
        "[Enforcing | Permissive | 1 | 0]"
 #define setenforce_full_usage ""
@@ -2972,22 +2886,6 @@ INSERT
 #define setfont_example_usage \
        "$ setfont -m koi8-r /etc/i18n/fontname\n"
 
-#define setkeycodes_trivial_usage \
-       "SCANCODE KEYCODE..."
-#define setkeycodes_full_usage "\n\n" \
-       "Set entries into the kernel's scancode-to-keycode map,\n" \
-       "allowing unusual keyboards to generate usable keycodes.\n\n" \
-       "SCANCODE may be either xx or e0xx (hexadecimal),\n" \
-       "and KEYCODE is given in decimal." \
-
-#define setkeycodes_example_usage \
-       "$ setkeycodes e030 127\n"
-
-#define setlogcons_trivial_usage \
-       "N"
-#define setlogcons_full_usage "\n\n" \
-       "Redirect the kernel output to console N (0 for current)"
-
 #define setsebool_trivial_usage \
        "boolean value"
 
@@ -3012,15 +2910,6 @@ INSERT
      "\n       -f FILE Read from FILE instead of /var/log/wtmp" \
        )
 
-#define showkey_trivial_usage \
-       "[-a | -k | -s]"
-#define showkey_full_usage "\n\n" \
-       "Show keys pressed\n" \
-     "\nOptions:" \
-     "\n       -a      Display decimal/octal/hex values of the keys" \
-     "\n       -k      Display interpreted keycodes (default)" \
-     "\n       -s      Display raw scan-codes" \
-
 #define slattach_trivial_usage \
        "[-cehmLF] [-s SPEED] [-p PROTOCOL] DEVICE"
 #define slattach_full_usage "\n\n" \