~sircmpwn/ctools

a3e3f27eecd53fc4cbd8a3f2a5c7695cd7dfe0c7 — Drew DeVault 2 years ago 705c6b4
Change usage strings again

Because it wasn't good enough for Simon
4 files changed, 15 insertions(+), 15 deletions(-)

M src/basename.c
M src/chgrp.c
M src/chmod.c
M src/cmp.c
M src/basename.c => src/basename.c +1 -1
@@ 5,7 5,7 @@
#include <string.h>
#include <time.h>

const char *usage = "usage: basename string [suffix]\n";
const char usage[] = "usage: basename string [suffix]\n";

int
main(int argc, char *argv[])

M src/chgrp.c => src/chgrp.c +7 -7
@@ 17,9 17,9 @@
#include <unistd.h>

static const char
	*chgrp_usage = "usage: chgrp <[-h] | -R [-H|-L|-P]> group file...",
	*chown_usage = "usage: chown <[-h] | -R [-H|-L|-P]> owner[:group] file...",
	*mutex = "-h and -R are mutually exclusive";
	chgrp_usage[] = "usage: chgrp <[-h] | -R [-H|-L|-P]> group file...\n",
	chown_usage[] = "usage: chown <[-h] | -R [-H|-L|-P]> owner[:group] file...\n",
	mutex[] = "%s: -h and -R are mutually exclusive\n";

enum program_mode {
	MODE_CHOWN,


@@ 142,14 142,14 @@ main(int argc, char *argv[])
		switch (c) {
		case 'h':
			if (ctx.recursive) {
				fprintf(stderr, "%s: %s\n", argv[0], mutex);
				fprintf(stderr, mutex, argv[0]);
				return 1;
			}
			ctx.explicit_links = true;
			break;
		case 'R':
			if (ctx.explicit_links) {
				fprintf(stderr, "%s: %s\n", argv[0], mutex);
				fprintf(stderr, mutex, argv[0]);
				return 1;
			}
			ctx.recursive = true;


@@ 164,7 164,7 @@ main(int argc, char *argv[])
			ctx.symlinks = UPDATE_LINKS;
			break;
		default:
			fprintf(stderr, "%s\n", ctx.mode == MODE_CHGRP ?
			fprintf(stderr, ctx.mode == MODE_CHGRP ?
					chgrp_usage : chown_usage);
			return 1;
		}


@@ 181,7 181,7 @@ main(int argc, char *argv[])
	argv = &argv[optind];

	if (argc < 2) {
		fprintf(stderr, "%s\n", ctx.mode == MODE_CHGRP ?
		fprintf(stderr, ctx.mode == MODE_CHGRP ?
				chgrp_usage : chown_usage);
		return 1;
	}

M src/chmod.c => src/chmod.c +3 -3
@@ 11,7 11,7 @@
#include <sys/types.h>
#include <time.h>

static const char *usage = "usage: chmod -R mode file...";
static const char usage[] = "usage: chmod -R mode file...\n";

enum mode_operation {
	MODE_SET, /* chmod 777 */


@@ 217,13 217,13 @@ main(int argc, char *argv[])
			recursive = true;
			break;
		default:
			fprintf(stderr, "%s\n", usage);
			fprintf(stderr, usage);
			return 1;
		}
	}

	if (optind + 1 >= argc) {
		fprintf(stderr, "%s\n", usage);
		fprintf(stderr, usage);
		return 1;
	}


M src/cmp.c => src/cmp.c +4 -4
@@ 7,10 7,10 @@
#include <time.h>
#include <unistd.h>

const char *usage = "usage: cmp [-l|-s] file1 file2\n",
      *mutex = "cmp: -l and -s are mutually exclusive\n",
      *both_stdin = "cmp: behavior is unspecified when both inputs are stdin\n",
      *special = "cmp: behavior is unspecified when both inputs are the "
const char usage[] = "usage: cmp [-l|-s] file1 file2\n",
      mutex[] = "cmp: -l and -s are mutually exclusive\n",
      both_stdin[] = "cmp: behavior is unspecified when both inputs are stdin\n",
      special[] = "cmp: behavior is unspecified when both inputs are the "
	      "same special file\n";

enum program_mode {