Add -h option
This commit is contained in:
parent
53df5feb06
commit
42fa1ec22e
2 changed files with 8 additions and 0 deletions
|
@ -5,4 +5,6 @@
|
|||
```sh
|
||||
$ make install
|
||||
$ flytex2html main.tex > out.html
|
||||
|
||||
$ flytex2html --help
|
||||
```
|
||||
|
|
|
@ -22,6 +22,10 @@ def main() -> None:
|
|||
arguments = sys.argv.copy()
|
||||
arguments.pop(0) # remove script name
|
||||
|
||||
if "-h" in arguments or "--help" in arguments:
|
||||
usage()
|
||||
sys.exit(1)
|
||||
|
||||
# Handle flags that don't come in pairs
|
||||
if "-v" in arguments or "--verbose" in arguments:
|
||||
try:
|
||||
|
@ -80,6 +84,8 @@ def usage() -> None:
|
|||
{executable} FILE [--origin-paths] [{{-t|--title}} TITLE] [{{-v|--verbose}}]
|
||||
|
||||
Options:
|
||||
-h, --help
|
||||
Print this help message and exit.
|
||||
--origin-paths
|
||||
Keep the paths in the input file as they are.
|
||||
This means you will probably need to copy the images over to destination.
|
||||
|
|
Loading…
Reference in a new issue