src/pod2rst-fix: Default syntax langague in POD = bash.

This commit is contained in:
Ole Tange 2024-06-27 13:43:58 +02:00
parent e1826c91c8
commit 56b5e8cb05
17 changed files with 77 additions and 41 deletions

View file

@ -14,6 +14,10 @@ License: GPL-3.0-or-later
Files: doc/citation-notice-faq.txt CREDITS NEWS README src/parallel_cheat_bw.fodt packager/debian/README doc/parallel*directive doc/screenshot.png Files: doc/citation-notice-faq.txt CREDITS NEWS README src/parallel_cheat_bw.fodt packager/debian/README doc/parallel*directive doc/screenshot.png
Copyright: 2007-2022 Ole Tange, http://ole.tange.dk and Free Software Foundation, Inc. Copyright: 2007-2022 Ole Tange, http://ole.tange.dk and Free Software Foundation, Inc.
License: GFDL-1.3-or-later License: GFDL-1.3-or-later
Files: doc/citation-notice-faq.txt CREDITS NEWS README src/parallel_cheat_bw.fodt packager/debian/README doc/parallel*directive doc/screenshot.png
Copyright: 2007-2022 Ole Tange, http://ole.tange.dk and Free Software Foundation, Inc.
# Dual license - copy of the previous paragraph
License: CC-BY-SA-4.0 License: CC-BY-SA-4.0
Files: testsuite/input-files/perl-v5.14.2/* testsuite/input-files/perllib/* Files: testsuite/input-files/perl-v5.14.2/* testsuite/input-files/perllib/*

View file

@ -245,14 +245,10 @@ http://freshmeat.net/projects/parallel/releases/new
https://hostux.social/@GNU_Parallel https://hostux.social/@GNU_Parallel
# Dead: https://joindiaspora.com/stream
New release of #GNU Parallel pi.dk/0 New release of #GNU Parallel pi.dk/0
New in this release pi.dk/2 New in this release pi.dk/2
See the intro videos pi.dk/1 See the intro videos pi.dk/1
10 secs installation: https://git.savannah.gnu.org/cgit/parallel.git/tree/README 10 secs installation: pi.dk/3
Aspect: Public
GNU Parallel - for people who live life in the parallel lane. GNU Parallel - for people who live life in the parallel lane.
@ -272,25 +268,23 @@ from:tange@gnu.org
to:parallel@gnu.org, bug-parallel@gnu.org to:parallel@gnu.org, bug-parallel@gnu.org
stable-bcc: Jesse Alama <jessealama@fastmail.fm> stable-bcc: Jesse Alama <jessealama@fastmail.fm>
Subject: GNU Parallel 20240622 ('34 counts') released Subject: GNU Parallel 20240722 ('Assange') released
GNU Parallel 20240622 ('34 counts') has been released. It is available for download at: lbry://@GnuParallel:4 GNU Parallel 20240722 ('Assange') has been released. It is available for download at: lbry://@GnuParallel:4
Quote of the month: Quote of the month:
The most glorious 15,000 lines of Perl ever written. <<>>
-- @nibblrrr7124@YouTube
New in this release: New in this release:
<<>>
* Bug fixes and man page updates. * Bug fixes and man page updates.
News about GNU Parallel: News about GNU Parallel:
* Howto - Parallel: lanciare comandi in simultanea https://github.com/linuxhubit/linuxhub.it/blob/main/_posts/2024-06-14-howto-parallel-per-lanciare-comandi-in-simultanea.md <<>>
* Implementing Concurrency in Shell Scripts https://dev.to/siddhantkcode/implementing-concurrency-in-shell-scripts-521o
GNU Parallel - For people who live life in the parallel lane. GNU Parallel - For people who live life in the parallel lane.

View file

@ -601,7 +601,7 @@ _parset_main() {
fi fi
if [ "$_parset_NAME" = "--version" ] ; then if [ "$_parset_NAME" = "--version" ] ; then
# shellcheck disable=SC2006 # shellcheck disable=SC2006
echo "parset 20240622 (GNU parallel `parallel --minversion 1`)" echo "parset 20240623 (GNU parallel `parallel --minversion 1`)"
echo "Copyright (C) 2007-2024 Ole Tange, http://ole.tange.dk and Free Software" echo "Copyright (C) 2007-2024 Ole Tange, http://ole.tange.dk and Free Software"
echo "Foundation, Inc." echo "Foundation, Inc."
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>" echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"

View file

@ -605,7 +605,7 @@ _parset_main() {
fi fi
if [ "$_parset_NAME" = "--version" ] ; then if [ "$_parset_NAME" = "--version" ] ; then
# shellcheck disable=SC2006 # shellcheck disable=SC2006
echo "parset 20240622 (GNU parallel `parallel --minversion 1`)" echo "parset 20240623 (GNU parallel `parallel --minversion 1`)"
echo "Copyright (C) 2007-2024 Ole Tange, http://ole.tange.dk and Free Software" echo "Copyright (C) 2007-2024 Ole Tange, http://ole.tange.dk and Free Software"
echo "Foundation, Inc." echo "Foundation, Inc."
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>" echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"

View file

@ -601,7 +601,7 @@ _parset_main() {
fi fi
if [ "$_parset_NAME" = "--version" ] ; then if [ "$_parset_NAME" = "--version" ] ; then
# shellcheck disable=SC2006 # shellcheck disable=SC2006
echo "parset 20240622 (GNU parallel `parallel --minversion 1`)" echo "parset 20240623 (GNU parallel `parallel --minversion 1`)"
echo "Copyright (C) 2007-2024 Ole Tange, http://ole.tange.dk and Free Software" echo "Copyright (C) 2007-2024 Ole Tange, http://ole.tange.dk and Free Software"
echo "Foundation, Inc." echo "Foundation, Inc."
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>" echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"

View file

@ -601,7 +601,7 @@ _parset_main() {
fi fi
if [ "$_parset_NAME" = "--version" ] ; then if [ "$_parset_NAME" = "--version" ] ; then
# shellcheck disable=SC2006 # shellcheck disable=SC2006
echo "parset 20240622 (GNU parallel `parallel --minversion 1`)" echo "parset 20240623 (GNU parallel `parallel --minversion 1`)"
echo "Copyright (C) 2007-2024 Ole Tange, http://ole.tange.dk and Free Software" echo "Copyright (C) 2007-2024 Ole Tange, http://ole.tange.dk and Free Software"
echo "Foundation, Inc." echo "Foundation, Inc."
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>" echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"

View file

@ -570,7 +570,7 @@ _parset_main() {
fi fi
if [ "$_parset_NAME" = "--version" ] ; then if [ "$_parset_NAME" = "--version" ] ; then
# shellcheck disable=SC2006 # shellcheck disable=SC2006
echo "parset 20240622 (GNU parallel `parallel --minversion 1`)" echo "parset 20240623 (GNU parallel `parallel --minversion 1`)"
echo "Copyright (C) 2007-2024 Ole Tange, http://ole.tange.dk and Free Software" echo "Copyright (C) 2007-2024 Ole Tange, http://ole.tange.dk and Free Software"
echo "Foundation, Inc." echo "Foundation, Inc."
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>" echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"

View file

@ -601,7 +601,7 @@ _parset_main() {
fi fi
if [ "$_parset_NAME" = "--version" ] ; then if [ "$_parset_NAME" = "--version" ] ; then
# shellcheck disable=SC2006 # shellcheck disable=SC2006
echo "parset 20240622 (GNU parallel `parallel --minversion 1`)" echo "parset 20240623 (GNU parallel `parallel --minversion 1`)"
echo "Copyright (C) 2007-2024 Ole Tange, http://ole.tange.dk and Free Software" echo "Copyright (C) 2007-2024 Ole Tange, http://ole.tange.dk and Free Software"
echo "Foundation, Inc." echo "Foundation, Inc."
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>" echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"

View file

@ -601,7 +601,7 @@ _parset_main() {
fi fi
if [ "$_parset_NAME" = "--version" ] ; then if [ "$_parset_NAME" = "--version" ] ; then
# shellcheck disable=SC2006 # shellcheck disable=SC2006
echo "parset 20240622 (GNU parallel `parallel --minversion 1`)" echo "parset 20240623 (GNU parallel `parallel --minversion 1`)"
echo "Copyright (C) 2007-2024 Ole Tange, http://ole.tange.dk and Free Software" echo "Copyright (C) 2007-2024 Ole Tange, http://ole.tange.dk and Free Software"
echo "Foundation, Inc." echo "Foundation, Inc."
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>" echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"

View file

@ -26,7 +26,7 @@
use strict; use strict;
use Getopt::Long; use Getopt::Long;
$Global::progname="niceload"; $Global::progname="niceload";
$Global::version = 20240622; $Global::version = 20240623;
Getopt::Long::Configure("bundling","require_order"); Getopt::Long::Configure("bundling","require_order");
get_options_from_array(\@ARGV) || die_usage(); get_options_from_array(\@ARGV) || die_usage();
if($opt::version) { if($opt::version) {

View file

@ -2794,7 +2794,7 @@ sub check_invalid_option_combinations() {
sub init_globals() { sub init_globals() {
# Defaults: # Defaults:
$Global::version = 20240622; $Global::version = 20240623;
$Global::progname = 'parallel'; $Global::progname = 'parallel';
$::name = "GNU Parallel"; $::name = "GNU Parallel";
$Global::infinity = 2**31; $Global::infinity = 2**31;

View file

@ -1775,7 +1775,7 @@ If in doubt use B<-X> as that will most likely do what is needed.
See also: B<-X> B<--xargs> See also: B<-X> B<--xargs>
=item B<--memfree> I<size> (alpha testing) =item B<--memfree> I<size> (beta testing)
Minimum memory free when starting another job. Minimum memory free when starting another job.
@ -1879,7 +1879,7 @@ is somewhat slower than B<--block>.
See also: UNIT PREFIX B<--pipe> B<--block> B<-m> B<-X> B<--max-args> See also: UNIT PREFIX B<--pipe> B<--block> B<-m> B<-X> B<--max-args>
=item B<--nonall> (alpha testing) =item B<--nonall> (beta testing)
B<--onall> with no arguments. B<--onall> with no arguments.
@ -1894,7 +1894,7 @@ servers.
See also: B<--onall> B<--sshlogin> See also: B<--onall> B<--sshlogin>
=item B<--onall> (alpha testing) =item B<--onall> (beta testing)
Run all the jobs on all computers given with B<--sshlogin>. Run all the jobs on all computers given with B<--sshlogin>.
@ -3896,10 +3896,14 @@ as 1M-12*2.024*2k.
GNU B<parallel> is very liberal in quoting. You only need to quote GNU B<parallel> is very liberal in quoting. You only need to quote
characters that have special meaning in shell: characters that have special meaning in shell:
=for pod2rst next-code-block: text
( ) $ ` ' " < > ; | \ ( ) $ ` ' " < > ; | \
and depending on context these needs to be quoted, too: and depending on context these needs to be quoted, too:
=for pod2rst next-code-block: text
~ & ! ? space * { # ~ & ! ? space * { #
Therefore most people will never need more quoting than putting '\' Therefore most people will never need more quoting than putting '\'
@ -4410,14 +4414,20 @@ you, file a bug-report.
If you get: If you get:
=for pod2rst next-code-block: text
Can't exec "command": No such file or directory Can't exec "command": No such file or directory
or: or:
=for pod2rst next-code-block: text
open3: exec of by command failed open3: exec of by command failed
or: or:
=for pod2rst next-code-block: text
/bin/bash: command: command not found /bin/bash: command: command not found
it may be because I<command> is not known, but it could also be it may be because I<command> is not known, but it could also be

View file

@ -1214,6 +1214,8 @@ B<rush> has some string manipulations that can be emulated by putting
this into ~/.parallel/config (/ is used instead of %, and % is used this into ~/.parallel/config (/ is used instead of %, and % is used
instead of ^ as that is closer to bash's ${var%postfix}): instead of ^ as that is closer to bash's ${var%postfix}):
=for pod2rst next-code-block: text
--rpl '{:} s:(\.[^/]+)*$::' --rpl '{:} s:(\.[^/]+)*$::'
--rpl '{:%([^}]+?)} s:$$1(\.[^/]+)*$::' --rpl '{:%([^}]+?)} s:$$1(\.[^/]+)*$::'
--rpl '{/:%([^}]*?)} s:.*/(.*)$$1(\.[^/]+)*$:$1:' --rpl '{/:%([^}]*?)} s:.*/(.*)$$1(\.[^/]+)*$:$1:'
@ -1368,6 +1370,8 @@ If you I<really> want the B<for>-loop:
Contrary to B<rush> this also works if the value is complex like: Contrary to B<rush> this also works if the value is complex like:
=for pod2rst next-code-block: text
My brother's 12" records My brother's 12" records
@ -1858,7 +1862,7 @@ emulated with GNU B<parallel>:
$ loopy touch '{= $_=seq()*5 =}'.txt $ loopy touch '{= $_=seq()*5 =}'.txt
$ loop --until-contains 200 -- \ $ loop --until-contains 200 -- \
./get_response_code.sh --site mysite.biz` ./get_response_code.sh --site mysite.biz
$ loopy --halt now,success=1 \ $ loopy --halt now,success=1 \
'./get_response_code.sh --site mysite.biz | match 200' './get_response_code.sh --site mysite.biz | match 200'
@ -4402,7 +4406,7 @@ cause segfault.
=head3 EXAMPLES =head3 EXAMPLES
simple.dat: simple.dat:
sleep 5 sleep 5
foo foo
@ -4410,9 +4414,9 @@ simple.dat:
loc src/parallelize.adb loc src/parallelize.adb
sh loc src/*.ad? sh loc src/*.ad?
1$ bin/parallelize -v <simple.dat 1$ bin/parallelize -v <simple.dat
1$ parallel <simple.dat 1$ parallel <simple.dat
https://github.com/simonjwright/parallelize https://github.com/simonjwright/parallelize
(Last checked: 2024-04) (Last checked: 2024-04)
@ -4606,6 +4610,8 @@ buffers on disk, they may not clean up, if they are killed.
It is not uncommon for users to create files like: It is not uncommon for users to create files like:
=for pod2rst next-code-block: text
My brother's 12" *** record (costs $$$).jpg My brother's 12" *** record (costs $$$).jpg
Some tools break on this. Some tools break on this.

View file

@ -2053,6 +2053,8 @@ your environment:
Output: Output:
=for pod2rst next-code-block: text
Joe's var is green Joe's var is green
The disadvantage is that if your environment is huge B<env_parallel> The disadvantage is that if your environment is huge B<env_parallel>
@ -2789,6 +2791,8 @@ This technique can be used for:
=item Common LISP: =item Common LISP:
=for pod2rst next-code-block: clisp
#!/usr/bin/parallel --shebang-wrap /usr/bin/clisp #!/usr/bin/parallel --shebang-wrap /usr/bin/clisp
(format t "~&~S~&" 'Arguments) (format t "~&~S~&" 'Arguments)
@ -2959,6 +2963,8 @@ B<--help> will print a summary of the most important options:
Output: Output:
=for pod2rst next-code-block: text
Usage: Usage:
parallel [options] [command [arguments]] < list_of_arguments parallel [options] [command [arguments]] < list_of_arguments
@ -3032,6 +3038,8 @@ generated using B<--citation>:
Output: Output:
=for pod2rst next-code-block: bash
Academic tradition requires you to cite works you base your article on. Academic tradition requires you to cite works you base your article on.
When using programs that use GNU Parallel to process data for publication When using programs that use GNU Parallel to process data for publication
please cite: please cite:

View file

@ -137,7 +137,7 @@ GetOptions(
"help" => \$opt::dummy, "help" => \$opt::dummy,
) || exit(255); ) || exit(255);
$Global::progname = ($0 =~ m:(^|/)([^/]+)$:)[1]; $Global::progname = ($0 =~ m:(^|/)([^/]+)$:)[1];
$Global::version = 20240622; $Global::version = 20240623;
if($opt::version) { version(); exit 0; } if($opt::version) { version(); exit 0; }
# Remove -D and --parallel=N # Remove -D and --parallel=N
my @s = (grep { ! /^-D$|^--parallel=\S+$/ } my @s = (grep { ! /^-D$|^--parallel=\S+$/ }

View file

@ -91,6 +91,20 @@ sub pre2 {
} }
} }
sub pre3 {
$/ = undef;
# Default syntax language: Bash
# If =for not already there, insert:
# =for pod2rst next-code-block: bash
$all = <STDIN>;
@codepar = split/(?<=\n .{0,25}\S.{0,200}\n{2,10})(?=[0-9a-zA-Z=])/, $all;
for(@codepar) {
/=for pod2rst next-code-block:/ and next;
s/((\n +\S))/\n=for pod2rst next-code-block: bash\n$1/;
}
print @codepar;
}
sub pod2rst { sub pod2rst {
exec "pod2rst"; exec "pod2rst";
} }
@ -109,5 +123,5 @@ sub post {
} }
} }
# stdin | pre1() | pre2() | pod2rst() | post() # stdin | pre1() | pre2() | pre3() | pod2rst() | post()
pipefunc(*pre1,*pre2,*pod2rst,*post); pipefunc(*pre1,*pre2,*pre3,*pod2rst,*post);

View file

@ -670,7 +670,7 @@ $Global::Initfile && unlink $Global::Initfile;
exit ($err); exit ($err);
sub parse_options { sub parse_options {
$Global::version = 20240622; $Global::version = 20240623;
$Global::progname = 'sql'; $Global::progname = 'sql';
# This must be done first as this may exec myself # This must be done first as this may exec myself