Completion & Documentation
Make your script usable by others (or your future self) without reading source code. Here are the tools to generate bash completion and markdown documentation.
Bash Completion (completely)
ParseArger uses completely to generate bash completion scripts. Usage: parseArger completely command-name ./script-file [options]
Arguments & Options
- command-name: The name of the command to generate completion for.
- file: The executable file for the command.
- --subcommand-directory / --subcmd-dir: If you have subcommands in a folder, point this to it to generate completion for them too.
parseArger completely my-script ./my-script --subcommand-directory ./bin - --completely-cmd / --cmpcmd: Specify how to run
completelyif it's not in your PATH (e.g., via Docker).parseArger completely my-script ./my-script --completely-cmd "docker run --rm -it completely" - --extra-file: Append extra YAML definitions for custom completion. Repeatable.
- --yaml-file: Custom name for the intermediate YAML file (default:
completely.yaml). - --completion-file: Output file name (default:
completely.bash). - --run-completely / --no-run-completely: Run
completelyto generate the bash script (default: on). Use--no-run-completelyto only output the YAML to stdout.parseArger completely my-script ./my-script --no-run-completely > completely.yaml - --discover-subcommand / --no-discover-subcommand: Auto-discover subcommands in the script (default: on).
Markdown Documentation (document)
Generate a README.md snippet directly from your argument definitions. Usage: parseArger document [options]
Arguments & Options
- --file / -f: File to document. Repeatable. First in, first out.
parseArger document --file ./script.sh --file ./other.sh - --directory / --folder / -d: Document all scripts in a directory. Repeatable.
parseArger document --directory ./bin - --out / -o: Output file. If omitted, prints to stdout.
parseArger document --file ./script.sh --out ./docs.md - --tag: Markdown tag for titles (default:
##). - --next-tag-prepend: String to prepend to the tag for subsequent levels (default:
#). - --title: The main title of the documentation (default:
Usage). - --title-tag: The tag for the main title (default:
#). - --sub-directory / --no-sub-directory: Recursively document subdirectories (default: on).
- --append-output / --no-append-output: Append to the output file instead of overwriting (default: on).
parseArger document --file ./script.sh --out ./docs.md --no-append-output