scriptdoc
Generate Markdown documentation for shell-scripts using the script library
Usage
scriptdoc src...
Notes
- Check
Makefilefor installation - Check
SCRIPT_PATH=scriptdoc pathfor paths - Extracts name, description,
requires_cmd,parse_args,parse_envandparse_conf parse_argsextraction could be inaccurate depending on processingparse_envandparse_confextraction does not include descriptionrequires_cmd,parse_args,parse_envandparse_confincludes dynamic values
Options
Environment variables can be defined to modify behaviour
scriptlibrary: Check documentation for options
Dependencies
Executables must be available in PATH
scriptlibrary
Example source code
#!/usr/bin/env bash
# Backup file system with path remapping and history managment
source "${SCRIPT_SRC:-/usr/local/share/script}"
requires_cmd 'rsync' 'rsync-escape' 'template'
parse_env 'conf' 'restore' 'dry'
parse_args 'dst'
parse_conf 'src'
backup
Backup file system with path remapping and history management
Usage
backup dst
Notes
- Check
Makefilefor installation - Check
SCRIPT_PATH=backup pathfor paths
Options
Environment variables can be defined to modify behaviour
scriptlibrary: Check documentation for optionsBACKUP_CONF:BACKUP_RESTORE:BACKUP_DRY:
Configuration
File follows shell-like definitions
SRC:
Dependencies
Executables must be available in PATH
scriptlibraryrsyncrsync-escapetemplate