diff options
Diffstat (limited to 'editors')
-rw-r--r-- | editors/awk.c | 8 | ||||
-rw-r--r-- | editors/cmp.c | 9 | ||||
-rw-r--r-- | editors/diff.c | 22 | ||||
-rw-r--r-- | editors/ed.c | 3 | ||||
-rw-r--r-- | editors/sed.c | 17 | ||||
-rw-r--r-- | editors/vi.c | 13 |
6 files changed, 72 insertions, 0 deletions
diff --git a/editors/awk.c b/editors/awk.c index 2eeb9d77a..9d38b1f88 100644 --- a/editors/awk.c +++ b/editors/awk.c | |||
@@ -7,6 +7,14 @@ | |||
7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | //usage:#define awk_trivial_usage | ||
11 | //usage: "[OPTIONS] [AWK_PROGRAM] [FILE]..." | ||
12 | //usage:#define awk_full_usage "\n\n" | ||
13 | //usage: "Options:" | ||
14 | //usage: "\n -v VAR=VAL Set variable" | ||
15 | //usage: "\n -F SEP Use SEP as field separator" | ||
16 | //usage: "\n -f FILE Read program from FILE" | ||
17 | |||
10 | #include "libbb.h" | 18 | #include "libbb.h" |
11 | #include "xregex.h" | 19 | #include "xregex.h" |
12 | #include <math.h> | 20 | #include <math.h> |
diff --git a/editors/cmp.c b/editors/cmp.c index f84a56e3e..3a0f5aa4f 100644 --- a/editors/cmp.c +++ b/editors/cmp.c | |||
@@ -10,6 +10,15 @@ | |||
10 | /* BB_AUDIT SUSv3 (virtually) compliant -- uses nicer GNU format for -l. */ | 10 | /* BB_AUDIT SUSv3 (virtually) compliant -- uses nicer GNU format for -l. */ |
11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/cmp.html */ | 11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/cmp.html */ |
12 | 12 | ||
13 | //usage:#define cmp_trivial_usage | ||
14 | //usage: "[-l] [-s] FILE1 [FILE2" IF_DESKTOP(" [SKIP1 [SKIP2]]") "]" | ||
15 | //usage:#define cmp_full_usage "\n\n" | ||
16 | //usage: "Compare FILE1 with FILE2 (or stdin)\n" | ||
17 | //usage: "\nOptions:" | ||
18 | //usage: "\n -l Write the byte numbers (decimal) and values (octal)" | ||
19 | //usage: "\n for all differing bytes" | ||
20 | //usage: "\n -s Quiet" | ||
21 | |||
13 | #include "libbb.h" | 22 | #include "libbb.h" |
14 | 23 | ||
15 | static const char fmt_eof[] ALIGN1 = "cmp: EOF on %s\n"; | 24 | static const char fmt_eof[] ALIGN1 = "cmp: EOF on %s\n"; |
diff --git a/editors/diff.c b/editors/diff.c index 3719bb49f..daa58af9b 100644 --- a/editors/diff.c +++ b/editors/diff.c | |||
@@ -76,6 +76,28 @@ | |||
76 | * 6n words for files of length n. | 76 | * 6n words for files of length n. |
77 | */ | 77 | */ |
78 | 78 | ||
79 | //usage:#define diff_trivial_usage | ||
80 | //usage: "[-abBdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2" | ||
81 | //usage:#define diff_full_usage "\n\n" | ||
82 | //usage: "Compare files line by line and output the differences between them.\n" | ||
83 | //usage: "This implementation supports unified diffs only.\n" | ||
84 | //usage: "\nOptions:" | ||
85 | //usage: "\n -a Treat all files as text" | ||
86 | //usage: "\n -b Ignore changes in the amount of whitespace" | ||
87 | //usage: "\n -B Ignore changes whose lines are all blank" | ||
88 | //usage: "\n -d Try hard to find a smaller set of changes" | ||
89 | //usage: "\n -i Ignore case differences" | ||
90 | //usage: "\n -L Use LABEL instead of the filename in the unified header" | ||
91 | //usage: "\n -N Treat absent files as empty" | ||
92 | //usage: "\n -q Output only whether files differ" | ||
93 | //usage: "\n -r Recurse" | ||
94 | //usage: "\n -S Start with FILE when comparing directories" | ||
95 | //usage: "\n -T Make tabs line up by prefixing a tab when necessary" | ||
96 | //usage: "\n -s Report when two files are the same" | ||
97 | //usage: "\n -t Expand tabs to spaces in output" | ||
98 | //usage: "\n -U Output LINES lines of context" | ||
99 | //usage: "\n -w Ignore all whitespace" | ||
100 | |||
79 | #include "libbb.h" | 101 | #include "libbb.h" |
80 | 102 | ||
81 | #if 0 | 103 | #if 0 |
diff --git a/editors/ed.c b/editors/ed.c index b1b6a8d27..41ac88c32 100644 --- a/editors/ed.c +++ b/editors/ed.c | |||
@@ -7,6 +7,9 @@ | |||
7 | * The "ed" built-in command (much simplified) | 7 | * The "ed" built-in command (much simplified) |
8 | */ | 8 | */ |
9 | 9 | ||
10 | //usage:#define ed_trivial_usage "" | ||
11 | //usage:#define ed_full_usage "" | ||
12 | |||
10 | #include "libbb.h" | 13 | #include "libbb.h" |
11 | 14 | ||
12 | typedef struct LINE { | 15 | typedef struct LINE { |
diff --git a/editors/sed.c b/editors/sed.c index d3555243f..9ab758bd7 100644 --- a/editors/sed.c +++ b/editors/sed.c | |||
@@ -58,6 +58,23 @@ | |||
58 | Reference http://www.opengroup.org/onlinepubs/007904975/utilities/sed.html | 58 | Reference http://www.opengroup.org/onlinepubs/007904975/utilities/sed.html |
59 | */ | 59 | */ |
60 | 60 | ||
61 | //usage:#define sed_trivial_usage | ||
62 | //usage: "[-efinr] SED_CMD [FILE]..." | ||
63 | //usage:#define sed_full_usage "\n\n" | ||
64 | //usage: "Options:" | ||
65 | //usage: "\n -e CMD Add CMD to sed commands to be executed" | ||
66 | //usage: "\n -f FILE Add FILE contents to sed commands to be executed" | ||
67 | //usage: "\n -i Edit files in-place (else sends result to stdout)" | ||
68 | //usage: "\n -n Suppress automatic printing of pattern space" | ||
69 | //usage: "\n -r Use extended regex syntax" | ||
70 | //usage: "\n" | ||
71 | //usage: "\nIf no -e or -f, the first non-option argument is the sed command string." | ||
72 | //usage: "\nRemaining arguments are input files (stdin if none)." | ||
73 | //usage: | ||
74 | //usage:#define sed_example_usage | ||
75 | //usage: "$ echo \"foo\" | sed -e 's/f[a-zA-Z]o/bar/g'\n" | ||
76 | //usage: "bar\n" | ||
77 | |||
61 | #include "libbb.h" | 78 | #include "libbb.h" |
62 | #include "xregex.h" | 79 | #include "xregex.h" |
63 | 80 | ||
diff --git a/editors/vi.c b/editors/vi.c index 602fc61d9..fd8bd0f78 100644 --- a/editors/vi.c +++ b/editors/vi.c | |||
@@ -21,6 +21,19 @@ | |||
21 | * An "ex" line oriented mode- maybe using "cmdedit" | 21 | * An "ex" line oriented mode- maybe using "cmdedit" |
22 | */ | 22 | */ |
23 | 23 | ||
24 | //usage:#define vi_trivial_usage | ||
25 | //usage: "[OPTIONS] [FILE]..." | ||
26 | //usage:#define vi_full_usage "\n\n" | ||
27 | //usage: "Edit FILE\n" | ||
28 | //usage: "\nOptions:" | ||
29 | //usage: IF_FEATURE_VI_COLON( | ||
30 | //usage: "\n -c Initial command to run ($EXINIT also available)" | ||
31 | //usage: ) | ||
32 | //usage: IF_FEATURE_VI_READONLY( | ||
33 | //usage: "\n -R Read-only" | ||
34 | //usage: ) | ||
35 | //usage: "\n -H Short help regarding available features" | ||
36 | |||
24 | #include "libbb.h" | 37 | #include "libbb.h" |
25 | 38 | ||
26 | /* the CRASHME code is unmaintained, and doesn't currently build */ | 39 | /* the CRASHME code is unmaintained, and doesn't currently build */ |