about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-11-03 22:35:26 +0100
committerLeah Neukirchen <leah@vuxu.org>2017-11-03 22:35:26 +0100
commitbdc66997c19b20f273d311b7e1837b298af13a30 (patch)
tree97106ef6f2d04c129cb145ddb2ec94a4bb35a6fb
parentc3549a011529adf18aa44406994e0e77657ad702 (diff)
downloadxe-bdc66997c19b20f273d311b7e1837b298af13a30.tar.gz
xe-bdc66997c19b20f273d311b7e1837b298af13a30.tar.xz
xe-bdc66997c19b20f273d311b7e1837b298af13a30.zip
tweak synopsis
-rw-r--r--README10
-rw-r--r--xe.111
-rw-r--r--xe.c3
3 files changed, 13 insertions, 11 deletions
diff --git a/README b/README
index e679830..c23f519 100644
--- a/README
+++ b/README
@@ -4,7 +4,8 @@ NAME
      xe – execute a command for every argument
 
 SYNOPSIS
-     xe [-0FLRnqv] [-p | -I replace-arg] [-N maxargs] [-j maxjobs] command ...
+     xe [-0FLRnqv] [-I replace-arg] [-N maxargs] [-j maxjobs] command ...
+     xe [flags ...] -p pattern command ... [+ pattern command ...]...
      xe [flags ...] -f argfile command ...
      xe [flags ...] -s shellscript
      xe [flags ...] -a command ... -- args ...
@@ -21,9 +22,8 @@ DESCRIPTION
      command ...
              By default, arguments - separated by newlines - are read from the
              standard input.  The resulting command is constructed from the
-             command line parameters, replacing replace-arg (unless -p is
-             used, see below) with the read argument, and is executed with
-             execvp(3).
+             command line parameters, replacing replace-arg with the read
+             argument, and is executed with execvp(3).
 
              In this mode, no shell is involved and replace-arg must appear as
              a word on its own, i.e.  ‘foo {} bar’ will work, but ‘foo{} bar’
@@ -164,4 +164,4 @@ LICENSE
 
            http://creativecommons.org/publicdomain/zero/1.0/
 
-Void Linux                       July 14, 2017                      Void Linux
+Void Linux                     November 3, 2017                     Void Linux
diff --git a/xe.1 b/xe.1
index 9661c73..2de5b2f 100644
--- a/xe.1
+++ b/xe.1
@@ -1,4 +1,4 @@
-.Dd July 14, 2017
+.Dd November 3, 2017
 .Dt XE 1
 .Os
 .Sh NAME
@@ -7,12 +7,16 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl 0FLRnqv
-.Oo Fl p | Fl I Ar replace-arg Oc
+.Oo Fl I Ar replace-arg Oc
 .Op Fl N Ar maxargs
 .Op Fl j Ar maxjobs
 .Ar command\ ...
 .Nm
 .Op Ar flags\ ...
+.Fl p Ar pattern Ar command\ ...
+.Oo Cm \&+ Ar pattern Ar command\ ... Oc Ns ...
+.Nm
+.Op Ar flags\ ...
 .Fl f Ar argfile Ar command\ ...
 .Nm
 .Op Ar flags\ ...
@@ -45,9 +49,6 @@ are read from the standard input.
 The resulting command is constructed from the command line parameters,
 replacing
 .Ar replace-arg
-(unless
-.Fl p
-is used, see below)
 with the read argument, and is executed with
 .Xr execvp 3 .
 .Pp
diff --git a/xe.c b/xe.c
index 12f98fb..df8f50d 100644
--- a/xe.c
+++ b/xe.c
@@ -615,7 +615,8 @@ main(int argc, char *argv[], char *envp[])
 		case 'v': vflag++; break;
 		default:
 			fprintf(stderr,
-			    "Usage: %s [-0FLRnqv] [-p | -I arg] [-N maxargs] [-j maxjobs] COMMAND...\n"
+			    "Usage: %s [-0FLRnqv] [-I arg] [-N maxargs] [-j maxjobs] COMMAND...\n"
+			    "     | -p PATTERN COMMAND... [+ PATTERN COMMAND...]...\n"
 			    "     | -f ARGFILE COMMAND...\n"
 			    "     | -s SHELLSCRIPT\n"
 			    "     | -a COMMAND... -- ARGS...\n"