psub: add -s, --suffix

This commit is contained in:
Eugene Sharygin
2015-02-16 15:28:11 +03:00
committed by Fabian Homborg
parent e31a93040e
commit 5db811253e
4 changed files with 69 additions and 26 deletions

View File

@@ -2,7 +2,7 @@
\subsection psub-synopsis Synopsis
\fish{synopsis}
COMMAND1 ( COMMAND2 | psub [-f] )
COMMAND1 ( COMMAND2 | psub [-f] [-s SUFFIX])
\endfish
\subsection psub-description Description
@@ -11,10 +11,15 @@ Posix shells feature a syntax that is a mix between command substitution and pip
If the `-f` or `--file` switch is given to `psub`, `psub` will use a regular file instead of a named pipe to communicate with the calling process. This will cause `psub` to be significantly slower when large amounts of data are involved, but has the advantage that the reading process can seek in the stream.
If the `-s` or `---suffix` switch is given, `psub` will append SUFFIX to the filename.
\subsection psub-example Example
\fish
diff (sort a.txt | psub) (sort b.txt | psub)
# shows the difference between the sorted versions of files `a.txt` and `b.txt`.
\endfish
source-highlight -f esc (cpp main.c | psub -s .c)
# highlights `main.c` after preprocessing as a C source.
\endfish