From c4be1ed54eff4542e7a8605007f73b381092df37 Mon Sep 17 00:00:00 2001 From: Robin Hahling Date: Sun, 16 Nov 2014 20:11:36 +0100 Subject: [PATCH] patch(1): Add dry-run alias for compatibility with other implementations Other implementations of patch(1), including GNU patch, "svn patch" and FreeBSD patch have a --dry-run option which does the same as our -C or --check option. Add --dry-run alias to increase compatibility. Taken-from: FreeBSD --- usr.bin/patch/patch.1 | 4 ++-- usr.bin/patch/patch.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/patch/patch.1 b/usr.bin/patch/patch.1 index 63eda1733e..9cfbf1d1bd 100644 --- a/usr.bin/patch/patch.1 +++ b/usr.bin/patch/patch.1 @@ -21,7 +21,7 @@ .\" .\" $OpenBSD: patch.1,v 1.26 2010/09/03 11:09:29 jmc Exp $ .\" $FreeBSD: head/usr.bin/patch/patch.1 249373 2013-04-11 18:46:41Z joel $ -.Dd February 6, 2014 +.Dd November 16, 2014 .Dt PATCH 1 .Os .Sh NAME @@ -107,7 +107,7 @@ This is equivalent to specifying This option is currently the default, unless .Fl -posix is specified. -.It Fl C , Fl Fl check +.It Fl C , Fl Fl check , Fl Fl dry-run Checks that the patch would apply cleanly, but does not modify anything. .It Fl c , Fl Fl context Forces diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c index 73bab16439..c1a551f12f 100644 --- a/usr.bin/patch/patch.c +++ b/usr.bin/patch/patch.c @@ -469,6 +469,7 @@ get_some_switches(void) {"context", no_argument, 0, 'c'}, {"debug", required_argument, 0, 'x'}, {"directory", required_argument, 0, 'd'}, + {"dry-run", no_argument, 0, 'C'}, {"ed", no_argument, 0, 'e'}, {"force", no_argument, 0, 'f'}, {"forward", no_argument, 0, 'N'}, -- 2.41.0