From c188e1313bb9808bab82e0a11b358bb1ec781049 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sun, 24 Sep 2017 18:43:33 +0200 Subject: add -p for percent rules --- xe.1 | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'xe.1') diff --git a/xe.1 b/xe.1 index fe7bc7b..b75209d 100644 --- a/xe.1 +++ b/xe.1 @@ -7,7 +7,7 @@ .Sh SYNOPSIS .Nm .Op Fl 0FLRnv -.Op Fl I Ar replace-arg +.Oo Fl p | Fl I Ar replace-arg Oc .Op Fl N Ar maxargs .Op Fl j Ar maxjobs .Ar command\ ... @@ -45,8 +45,12 @@ 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 In this mode, no shell is involved and .Ar replace-arg must appear as a word on its own, i.e. @@ -122,6 +126,29 @@ Dry run: don't run the resulting commands, just print them. .It Fl v Verbose: print commands to standard error before running them. When used twice, also print job id and exit status for each command. +.It Fl p +Enable +.Em percent rules : +this mode disables the default +.Ar replace-arg +substition and enables +.Xr make 1 Ns \&- Ns +style percent rules. +The first argument of +.Ar command\ ... +is regarded as a pattern: +in the pattern, a single occurrence of +.Li Sq \&% +matches one or more characters, +and replaces the first occurrence of +.Li Sq \&% +with the matched string in the remaining arguments, +which are then used as the command to be executed. +.Pp +Multiple runs of patterns and commands are separated by +.Li Sq \&+ . +Only the first matching percent rule is executed; +when no pattern matches, no command is run. .It Fl I Ar replace-arg Replace first occurrence of .Ar replace-arg -- cgit 1.4.1