From 17c838bc6da9ff7defb2a8d5ff539ec743acc1fc Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sat, 24 Oct 2009 17:11:55 +0200 Subject: patch: add longopts, --dry-run, add one more test function old new delta patch_main 1110 1214 +104 static.patch_longopts - 47 +47 packed_usage 26738 26761 +23 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/0 up/down: 174/0) Total: 174 bytes Signed-off-by: Denys Vlasenko --- include/usage.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'include/usage.h') diff --git a/include/usage.h b/include/usage.h index d03ec2295..85561c558 100644 --- a/include/usage.h +++ b/include/usage.h @@ -898,7 +898,7 @@ "\n -d Daemonize" \ #define dos2unix_trivial_usage \ - "[OPTION] [FILE]" + "[OPTIONS] [FILE]" #define dos2unix_full_usage "\n\n" \ "Convert FILE in-place from DOS to Unix format.\n" \ "When no file is given, use stdin/stdout.\n" \ @@ -907,7 +907,7 @@ "\n -d unix2dos" \ #define unix2dos_trivial_usage \ - "[OPTION] [FILE]" + "[OPTIONS] [FILE]" #define unix2dos_full_usage "\n\n" \ "Convert FILE in-place from Unix to DOS format.\n" \ "When no file is given, use stdin/stdout.\n" \ @@ -3250,12 +3250,21 @@ ) #define patch_trivial_usage \ - "[-p NUM] [-i DIFF] [-R] [-N]" + "[OPTIONS] [ORIGFILE [PATCHFILE]]" #define patch_full_usage "\n\n" \ + IF_LONG_OPTS( \ + " -p,--strip NUM Strip NUM leading components from file names" \ + "\n -i,--input DIFF Read DIFF instead of stdin" \ + "\n -R,--reverse Reverse patch" \ + "\n -N,--forward Ignore already applied patches" \ + "\n --dry-run Don't actually change files" \ + ) \ + IF_NOT_LONG_OPTS( \ " -p NUM Strip NUM leading components from file names" \ "\n -i DIFF Read DIFF instead of stdin" \ "\n -R Reverse patch" \ "\n -N Ignore already applied patches" \ + ) #define patch_example_usage \ "$ patch -p1 < example.diff\n" \ -- cgit v1.2.3