Skip to content

Commit

Permalink
Add Automatic Variables section.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronriekenberg committed May 4, 2024
1 parent 6246aa2 commit 6e2344f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/generate_manual.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ echo "## Manual for rust-parallel $VERSION"
echo '
1. [Command line options](#command-line-options)
1. [Commands from arguments](#commands-from-arguments)
1. [Automatic variables](#automatic-variables)
1. [Commands from stdin](#commands-from-stdin)
1. [Command and initial arguments on command line](#command-and-initial-arguments-on-command-line)
1. [Reading multiple inputs](#reading-multiple-inputs)
Expand Down Expand Up @@ -58,14 +59,18 @@ echo '
$ rust-parallel gzip -k ::: *.html
```'

echo 'Variables `{0}`, `{1}`, etc are automatically available based on the number of arguments. `{0}` will be replaced by the entire input line, and other groups match individual argument groups This is useful for building more complex command lines. For example:
echo '### Automatic Variables'

echo 'When using commands from arguments, numbered variables `{0}`, `{1}`, etc are automatically available based on the number of arguments. `{0}` will be replaced by the entire input line, and other groups match individual argument groups This is useful for building more complex command lines. For example:
'

echo '```
$ rust-parallel echo group0={0} group1={1} group2={2} group3={3} group2again={2} ::: A B ::: C D ::: E F G'
$RUST_PARALLEL echo group0={0} group1={1} group2={2} group3={3} group2again={2} ::: A B ::: C D ::: E F G
echo '```'

echo 'Internally these variables are implemented using an auto-generated [regular expression](#regular-expression). If a regular expression is manually specified this will override the auto-generated one.'

echo '## Commands from stdin
Run complete commands from stdin.
Expand Down

0 comments on commit 6e2344f

Please sign in to comment.