diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 1 | ||||
-rw-r--r-- | include/usage.h | 50 |
2 files changed, 38 insertions, 13 deletions
diff --git a/include/libbb.h b/include/libbb.h index 93ab5375c..0119aabe4 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -137,6 +137,7 @@ extern long *find_pid_by_name( const char* pidName); | |||
137 | extern char *find_real_root_device_name(void); | 137 | extern char *find_real_root_device_name(void); |
138 | extern char *bb_get_line_from_file(FILE *file); | 138 | extern char *bb_get_line_from_file(FILE *file); |
139 | extern char *bb_get_chomped_line_from_file(FILE *file); | 139 | extern char *bb_get_chomped_line_from_file(FILE *file); |
140 | extern char *bb_get_chunk_from_file(FILE *file); | ||
140 | extern int bb_copyfd_size(int fd1, int fd2, const off_t size); | 141 | extern int bb_copyfd_size(int fd1, int fd2, const off_t size); |
141 | extern int bb_copyfd_eof(int fd1, int fd2); | 142 | extern int bb_copyfd_eof(int fd1, int fd2); |
142 | extern void bb_xprint_and_close_file(FILE *file); | 143 | extern void bb_xprint_and_close_file(FILE *file); |
diff --git a/include/usage.h b/include/usage.h index 7cf44d74a..c53ead0c7 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -2193,24 +2193,40 @@ | |||
2193 | USAGE_FANCY_SLEEP("$ sleep 1d 3h 22m 8s\n" \ | 2193 | USAGE_FANCY_SLEEP("$ sleep 1d 3h 22m 8s\n" \ |
2194 | "[98528 second delay results]\n") | 2194 | "[98528 second delay results]\n") |
2195 | 2195 | ||
2196 | #ifdef CONFIG_FEATURE_SORT_UNIQUE | 2196 | #ifdef CONFIG_SORT_BIG |
2197 | #define USAGE_SORT_UNIQUE(a) a | 2197 | #define USAGE_SORT_BIG(a) a |
2198 | #else | 2198 | #else |
2199 | #define USAGE_SORT_UNIQUE(a) | 2199 | #define USAGE_SORT_BIG(a) |
2200 | #endif | ||
2201 | #ifdef CONFIG_FEATURE_SORT_REVERSE | ||
2202 | #define USAGE_SORT_REVERSE(a) a | ||
2203 | #else | ||
2204 | #define USAGE_SORT_REVERSE(a) | ||
2205 | #endif | 2200 | #endif |
2201 | |||
2202 | |||
2206 | #define sort_trivial_usage \ | 2203 | #define sort_trivial_usage \ |
2207 | "[-n" USAGE_SORT_REVERSE("r") USAGE_SORT_UNIQUE("u") "] [FILE]..." | 2204 | "[-nru" USAGE_SORT_BIG("gMcszbdfimSTokt] [-o outfile] [-k start[.offset][opts][,end[.offset][opts]] [-t char") "] [FILE]..." |
2208 | #define sort_full_usage \ | 2205 | #define sort_full_usage \ |
2209 | "Sorts lines of text in the specified files\n\n"\ | 2206 | "Sorts lines of text in the specified files\n\n"\ |
2210 | "Options:\n" \ | 2207 | "Options:\n" \ |
2211 | USAGE_SORT_UNIQUE("\t-u\tsuppress duplicate lines\n") \ | 2208 | USAGE_SORT_BIG( \ |
2212 | USAGE_SORT_REVERSE("\t-r\tsort in reverse order\n") \ | 2209 | "\t-b\tignore leading blanks\n" \ |
2213 | "\t-n\tsort numerics" | 2210 | "\t-c\tcheck whether input is sorted\n" \ |
2211 | "\t-d\tdictionary order (blank or alphanumeric only)\n" \ | ||
2212 | "\t-f\tignore case\n" \ | ||
2213 | "\t-g\tgeneral numerical sort\n" \ | ||
2214 | "\t-i\tignore unprintable characters\n" \ | ||
2215 | "\t-k\tspecify sort key\n" \ | ||
2216 | "\t-M\tsort month\n" \ | ||
2217 | ) \ | ||
2218 | "\t-n\tsort numbers\n" \ | ||
2219 | USAGE_SORT_BIG( \ | ||
2220 | "\t-o\toutput to file\n" \ | ||
2221 | "\t-k\tsort by key\n" \ | ||
2222 | "\t-t\tuse key separator other than whitespace\n" \ | ||
2223 | ) \ | ||
2224 | "\t-r\treverse sort order\n" \ | ||
2225 | USAGE_SORT_BIG("\t-s\tstable (don't sort ties alphabetically)\n") \ | ||
2226 | "\t-u\tsuppress duplicate lines" \ | ||
2227 | USAGE_SORT_BIG("\n\t-z\tinput terminated by nulls, not newlines\n") \ | ||
2228 | USAGE_SORT_BIG("\t-mST\tignored for GNU compatability") \ | ||
2229 | "" | ||
2214 | #define sort_example_usage \ | 2230 | #define sort_example_usage \ |
2215 | "$ echo -e \"e\\nf\\nb\\nd\\nc\\na\" | sort\n" \ | 2231 | "$ echo -e \"e\\nf\\nb\\nd\\nc\\na\" | sort\n" \ |
2216 | "a\n" \ | 2232 | "a\n" \ |
@@ -2218,7 +2234,15 @@ | |||
2218 | "c\n" \ | 2234 | "c\n" \ |
2219 | "d\n" \ | 2235 | "d\n" \ |
2220 | "e\n" \ | 2236 | "e\n" \ |
2221 | "f\n" | 2237 | "f\n" \ |
2238 | USAGE_SORT_BIG( \ | ||
2239 | "$ echo -e \"c 3\\nb 2\\nd 2\" | $SORT -k 2,2n -k 1,1r\n" \ | ||
2240 | "d 2\n" \ | ||
2241 | "b 2\n" \ | ||
2242 | "c 3\n" \ | ||
2243 | ) \ | ||
2244 | "" | ||
2245 | |||
2222 | 2246 | ||
2223 | #define start_stop_daemon_trivial_usage \ | 2247 | #define start_stop_daemon_trivial_usage \ |
2224 | "[OPTIONS] [--start|--stop] ... [-- arguments...]\n" | 2248 | "[OPTIONS] [--start|--stop] ... [-- arguments...]\n" |