style(bash-v2): various cleanups (#1702)
* use arithmetic evaluation in numeric context
* remove unnecessary $ from array index variables
* [[ ]] over [ ], == over =, remove unnecessary quoting
* use ${foo-} rather than ${foo:-} in emptiness check
The result of the expansion is null no matter if the variable is unset
or null in both cases; the former form is arguably easier on the eye.
* remove unnecessary trailing linefeed removal
No longer needed as of f464d6c82e9af74b7a46301a775163984af32cd1, saves
a subshell.
* use herestring in activehelp extraction
Herestrings read cleaner than process substitutions, and work in posix
mode (but we do and will have some process substitutions so this doesn't
matter much). Both approaches may end up using temporary files. V
Ville Skyttä committed
badcce14f8e828cda4d8ac404a12448700de1441
Parent: 1424b7b
Committed by GitHub <noreply@github.com>
on 10/17/2022, 7:24:27 PM