help affiche des informations sur les commandes intégrées. Quelle est la source d'aide? Maintient-il une base de données pour les commandes intégrées ou lit-il certains fichiers de chaque commande intégrée (semblable à la page de manuel de chaque utilitaire)?
Parfois, je trouve que ses informations semblent --help
$ cd --help
bash: cd: --: invalid option
cd: usage: cd [-L|[-P [-e]]] [dir]
$ help cd
cd: cd [-L|[-P [-e]]] [dir]
Change the shell working directory.
Change the current directory to DIR. The default DIR is the value of the
HOME shell variable.
The variable CDPATH defines the search path for the directory containing
DIR. Alternative directory names in CDPATH are separated by a colon (:).
A null directory name is the same as the current directory. If DIR begins
with a slash (/), then CDPATH is not used.
If the directory is not found, and the shell option `cdable_vars' is set,
the word is assumed to be a variable name. If that variable has a value,
its value is used for DIR.
Options:
-L force symbolic links to be followed
-P use the physical directory structure without following symbolic
links
-e if the -P option is supplied, and the current working directory
cannot be determined successfully, exit with a non-zero status
The default is to follow symbolic links, as if `-L' were specified.
Exit Status:
Returns 0 if the directory is changed, and if $PWD is set successfully when
-P is used; non-zero otherwise.
Je pensais helpextraire la partie d'aide de l'exécutable, mais pour un script python pdf-merge.py , ce n'est pas
$ help ./pdf-merge.py
bash: help: no help topics match `./pdf-merge.py'. Try `help help' or `man -k ./pdf-merge.py' or `info ./pdf-merge.py'.
$ ./pdf-merge.py --help
usage: pdf-merge.py [-h] [-v] [--ask] [--output OUTPUT] [--title TITLE]
[--author AUTHOR] [--keyword KEYWORD] [--pdftk PDFTK]
[--gs GS] [--pdfmarks PDFMARKS] [--unicode]
PDF [PDF ...]
Merge PDFs preserving bookmarks. Thanks to Larry Cai for suggesting that
Unicode be supported and for discussion about the `--pdfmarks` option.
positional arguments:
PDF an input PDF to merge
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
--ask pause for manual pdfmark tweaking
--output OUTPUT name of the output PDF
--title TITLE title of output PDF
--author AUTHOR author of output PDF
--keyword KEYWORD keywords for the output PDF
--pdftk PDFTK path to the pdftk executable
--gs GS path to the gs (Ghostscript) executable
--pdfmarks PDFMARKS path to pdfmarks file. If not given, a temporary file
is used. If given and the file is missing, execution
will stop after the file is created (before the
Ghostscript run). If given and the file exists, no
attempt will be make to use pdftk to generate the mark
file (I assume your input file is what you want).
--unicode instead of merging PDFs, convert PDF-formatted unicode
strings. For example `--unicode '<FEFF03B103B203B3>'
\u03b1\u03b2\u03b3`
mancommande, et dans les systèmes qui la prennent en charge, la infocommande.
cdn'a pas d'--helpoption. Ce que vous voyez est le message d'utilisation de base que vous obtenez lorsque vous essayez d'utiliser un indicateur d'option non valide.