Unifying usage screens

This commit is contained in:
Pierre Pronchery 2007-08-17 17:03:33 +00:00
parent 25d1644d43
commit cc60015ea7
20 changed files with 66 additions and 64 deletions

View File

@ -97,7 +97,7 @@ static int _write_nonbuf(int c)
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: cat [-u][file ...]\n\ fputs("Usage: cat [-u][file ...]\n\
-u write without delay\n", stderr); -u Write without delay\n", stderr);
return 1; return 1;
} }

View File

@ -120,7 +120,7 @@ static int _chmod_do_recursive_do(int opts, mode_t mode, char * file)
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: chmod [-R] mode file\n\ fputs("Usage: chmod [-R] mode file\n\
-R recursively change file mode bits\n", stderr); -R Recursively change file mode bits\n", stderr);
return 1; return 1;
} }

View File

@ -115,8 +115,8 @@ static int _cmp_files(OutputType ot, char const * file1, char const * file2,
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: cmp [-l|-s] file1 file2\n\ fputs("Usage: cmp [-l|-s] file1 file2\n\
-l write the byte number and the differing byte for each difference\n\ -l Write the byte number and the differing byte for each difference\n\
-s write nothing for differing bytes\n", stderr); -s Write nothing for differing bytes\n", stderr);
return 2; return 2;
} }

View File

@ -185,12 +185,12 @@ static void _du_print(Prefs * prefs, off_t size, char const * filename)
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: du [-a | -s][-kx][-H | -L][file...]\n\ fputs("Usage: du [-a | -s][-kx][-H | -L][file...]\n\
-a report the size of every file encountered\n\ -a Report the size of every file encountered\n\
-s report only the total sum for each of the specified files\n\ -s Report only the total sum for each of the specified files\n\
-k write the file sizes in units of 1024 bytes rather than 512\n\ -k Write the file sizes in units of 1024 bytes rather than 512\n\
-x evaluate file sizes only on the same device as the file specified\n\ -x Evaluate file sizes only on the same device as the file specified\n\
-H dereference specified files\n\ -H Dereference specified files\n\
-L dereference every file evaluated\n", stderr); -L Dereference every file evaluated\n", stderr);
return 1; return 1;
} }

View File

@ -70,7 +70,7 @@ static int _head_do(int flgn, char * filename)
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: head [-n number][file...]\n\ fputs("Usage: head [-n number][file...]\n\
-n print first number lines on standard output\n", stderr); -n Print first number lines on standard output\n", stderr);
return 1; return 1;
} }

View File

@ -252,11 +252,11 @@ static struct group * _print_gid(gid_t gid)
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: id [-Ggu][-nr] [user]\n\ fputs("Usage: id [-Ggu][-nr] [user]\n\
-G output all different group IDs\n\ -G Output all different group IDs\n\
-g output only the effective group ID\n\ -g Output only the effective group ID\n\
-u output only the effective user ID\n\ -u Output only the effective user ID\n\
-n output the name as a string\n\ -n Output the name as a string\n\
-r output the real ID instead of the effective ID\n", stderr); -r Output the real ID instead of the effective ID\n", stderr);
return 1; return 1;
} }

View File

@ -56,8 +56,8 @@ static int _usage(void)
{ {
fputs("Usage: kill -s signal_name pid...\n\ fputs("Usage: kill -s signal_name pid...\n\
kill -l [exit_status]\n\ kill -l [exit_status]\n\
-l write all signal values supported\n\ -l Write all signal values supported\n\
-s specify the signal to send\n", stderr); -s Specify the signal to send\n", stderr);
return 1; return 1;
} }

View File

@ -13,6 +13,8 @@
* You should have received a copy of the Creative Commons Attribution- * You should have received a copy of the Creative Commons Attribution-
* NonCommercial-ShareAlike 3.0 along with utils; if not, browse to * NonCommercial-ShareAlike 3.0 along with utils; if not, browse to
* http://creativecommons.org/licenses/by-nc-sa/3.0/ */ * http://creativecommons.org/licenses/by-nc-sa/3.0/ */
/* TODO
* - implement and use _ln_error() */
@ -106,9 +108,9 @@ static int _ln_multiple(LinkForce lf, LinkType lt, int argc, char * argv[])
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: ln [-fs] source_file target_file\n\ fputs("Usage: ln [-fs] source_file target_file\n\
ln [-fs] source_file ... target_dir\n\ ln [-fs] source_file ... target_dir\n\
-f force existing destination pathnames to be removed\n\ -f Force existing destination pathnames to be removed\n\
-s create symbolic links instead of hard links\n", stderr); -s Create symbolic links instead of hard links\n", stderr);
return 1; return 1;
} }

View File

@ -684,18 +684,18 @@ static int _ls_do_dirs(Prefs * prefs, int argc, SList * dirs)
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: ls [-CFRacdilqrtu1][-H | -L]\n\ fputs("Usage: ls [-CFRacdilqrtu1][-H | -L]\n\
-C write multi-column output\n\ -C Write multi-column output\n\
-F write a symbol after files names depending on their type\n\ -F Write a symbol after files names depending on their type\n\
-R recursively list subdirectories encountered\n\ -R Recursively list subdirectories encountered\n\
-a write out all hidden directory entries\n\ -a Write out all hidden directory entries\n\
-c use time of last modification of file status\n\ -c Use time of last modification of file status\n\
-d treat directories like files\n\ -d Treat directories like files\n\
-l write out in long format\n\ -l Write out in long format\n\
-t sort with the last modified file first\n\ -t Sort with the last modified file first\n\
-u use time of last access\n\ -u Use time of last access\n\
-1 force output to be one entry per line\n\ -1 Force output to be one entry per line\n\
-H dereference symbolic links\n\ -H Dereference symbolic links\n\
-L evaluate symbolic links\n", stderr); -L Evaluate symbolic links\n", stderr);
return 1; return 1;
} }

View File

@ -84,8 +84,8 @@ static int _mkdir_p(mode_t mode, char * pathname)
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: mkdir [-p][-m mode] dir...\n\ fputs("Usage: mkdir [-p][-m mode] dir...\n\
-p create any missing intermediate pathname components\n\ -p Create any missing intermediate pathname components\n\
-m file permission bits of the newly-created directory\n", stderr); -m File permission bits of the newly-created directory\n", stderr);
return 1; return 1;
} }

View File

@ -51,7 +51,7 @@ static int _mkfifo_error(char * message, int ret)
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: mkfifo [-m mode] file...\n\ fputs("Usage: mkfifo [-m mode] file...\n\
-m create fifo with the specified mode value\n", stderr); -m Create fifo with the specified mode value\n", stderr);
return 1; return 1;
} }

View File

@ -45,7 +45,7 @@ static int _nice_error(char * message, int ret)
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: nice [-n increment] utility [argument...]\n\ fputs("Usage: nice [-n increment] utility [argument...]\n\
-n priority to set\n", stderr); -n Priority to set\n", stderr);
return 1; return 1;
} }

View File

@ -97,8 +97,8 @@ static int _pwd_error(char const * message, int ret)
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: pwd [-L|-P]\n\ fputs("Usage: pwd [-L|-P]\n\
-L avoid \".\" or \"..\" filenames\n\ -L Avoid \".\" or \"..\" filenames\n\
-P avoid symbolic links\n", stderr); -P Avoid symbolic links\n", stderr);
return 1; return 1;
} }

View File

@ -60,10 +60,10 @@ static int _renice_error(char * message, int ret)
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: renice -n increment [-g | -p | -u] ID...\n\ fputs("Usage: renice -n increment [-g | -p | -u] ID...\n\
-n priority to set\n\ -n Priority to set\n\
-g process group IDs\n\ -g Process group IDs\n\
-p integer process IDs\n\ -p Integer process IDs\n\
-u user IDs\n", stderr); -u User IDs\n", stderr);
return 1; return 1;
} }

View File

@ -69,7 +69,7 @@ static int _rmdir_p(char * pathname)
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: rmdir [-p] dir...\n\ fputs("Usage: rmdir [-p] dir...\n\
-p remove all directories in a pathname\n", stderr); -p Remove all directories in a pathname\n", stderr);
return 1; return 1;
} }

View File

@ -99,7 +99,7 @@ static int _time_print(long real, long user, long sys)
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: time [-p] utility [argument...]\n\ fputs("Usage: time [-p] utility [argument...]\n\
-p force the POSIX locale\n", stderr); -p Force the POSIX locale\n", stderr);
return 1; return 1;
} }

View File

@ -293,11 +293,11 @@ static int _touch_do(Prefs * prefs, char * filename, time_t atime, time_t mtime)
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: touch [-acm][-r ref_file|-t time] file...\n\ fputs("Usage: touch [-acm][-r ref_file|-t time] file...\n\
-a change the access time\n\ -a Change the access time\n\
-c do not create file if it doesn't exist\n\ -c Do not create file if it doesn't exist\n\
-m change the modification time\n\ -m Change the modification time\n\
-r use the time of the given file\n\ -r Use the time of the given file\n\
-t use the specified time as [[CC]YY]MMDDhhmm[.SS]\n", stderr); -t Use the specified time as [[CC]YY]MMDDhhmm[.SS]\n", stderr);
return 1; return 1;
} }

View File

@ -53,12 +53,12 @@ static int _uname(int m, int n, int r, int s, int v)
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: uname [-snrvma]\n\ fputs("Usage: uname [-snrvma]\n\
-s operating system name\n\ -s Operating system name\n\
-n name of this node on the network\n\ -n Name of this node on the network\n\
-r operating system release name\n\ -r Operating system release name\n\
-v operating system version\n\ -v Operating system version\n\
-m hardware type\n\ -m Hardware type\n\
-a all the options above\n", stderr); -a All the options above\n", stderr);
return 1; return 1;
} }

View File

@ -159,10 +159,10 @@ static int _usage(void)
{ {
fputs("Usage: uniq [-c|-d|-u][-f fields][-s char][input_file\ fputs("Usage: uniq [-c|-d|-u][-f fields][-s char][input_file\
[output_file]]\n\ [output_file]]\n\
-c precede each output line with a count of the repetitions for the line\n\ -c Precede each output line with a count of the repetitions for the line\n\
-d suppress the writing of lines that are not repeated\n\ -d Suppress the writing of lines that are not repeated\n\
-s ignore the first char characters when doing comparisons\n\ -s Ignore the first char characters when doing comparisons\n\
-u suppress the writing of lines that are repeated\n", stderr); -u Suppress the writing of lines that are repeated\n", stderr);
return 1; return 1;
} }

View File

@ -122,10 +122,10 @@ static void _wc_print(int flags, unsigned int cm, unsigned int l,
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: wc [-c|-m][-lw][file...]\n\ fputs("Usage: wc [-c|-m][-lw][file...]\n\
-c write the number of bytes\n\ -c Write the number of bytes\n\
-m write the number of characters\n\ -m Write the number of characters\n\
-l write the number of lines\n\ -l Write the number of lines\n\
-w write the number of words\n", stderr); -w Write the number of words\n", stderr);
return 1; return 1;
} }