summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorVadim Zhukov <zhuk@cvs.openbsd.org>2018-06-22 15:37:16 +0000
committerVadim Zhukov <zhuk@cvs.openbsd.org>2018-06-22 15:37:16 +0000
commit4659f1a518bb27b99e22d692ffce48751b281109 (patch)
tree06a9921721a43587130967605d59c1153a667897 /usr.bin
parentf53725cab046e94f478bba6eb1cd63a0ad2637b5 (diff)
Add --dry-run as synonym to -C/--check.
FreeBSD and NetBSD has this for a while, and GNU patch got it even earlier than we got -C. input from sthen@ & jca@; okay sthen@, jca@ and deraadt@.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/patch/patch.16
-rw-r--r--usr.bin/patch/patch.c3
2 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/patch/patch.1 b/usr.bin/patch/patch.1
index 4965775e2a1..8d915b87287 100644
--- a/usr.bin/patch/patch.1
+++ b/usr.bin/patch/patch.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: patch.1,v 1.31 2018/04/11 10:06:50 zhuk Exp $
+.\" $OpenBSD: patch.1,v 1.32 2018/06/22 15:37:15 zhuk Exp $
.\" Copyright 1986, Larry Wall
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -19,7 +19,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd $Mdocdate: April 11 2018 $
+.Dd $Mdocdate: June 22 2018 $
.Dt PATCH 1
.Os
.Sh NAME
@@ -99,7 +99,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 b0627c89b86..0cb924db733 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: patch.c,v 1.65 2018/04/07 14:55:13 anton Exp $ */
+/* $OpenBSD: patch.c,v 1.66 2018/06/22 15:37:15 zhuk Exp $ */
/*
* patch - a program to apply diffs to original files
@@ -454,6 +454,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'},