aboutsummaryrefslogtreecommitdiff

scriptdoc

Generate Markdown documentation for shell-scripts using the script library

Usage

scriptdoc src...

Notes

  • Check Makefile for installation
  • Check SCRIPT_PATH=scriptdoc path for paths
  • Extracts name, description, requires_cmd, parse_args, parse_env and parse_conf
  • parse_args extraction could be inaccurate depending on processing
  • parse_env and parse_conf extraction does not include description
  • requires_cmd, parse_args, parse_env and parse_conf includes dynamic values

Options

Environment variables can be defined to modify behaviour

  • script library: Check documentation for options

Dependencies

Executables must be available in PATH

  • script library

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 Makefile for installation
  • Check SCRIPT_PATH=backup path for paths

Options

Environment variables can be defined to modify behaviour

  • script library: Check documentation for options
  • BACKUP_CONF:
  • BACKUP_RESTORE:
  • BACKUP_DRY:

Configuration

File follows shell-like definitions

  • SRC:

Dependencies

Executables must be available in PATH

  • script library
  • rsync
  • rsync-escape
  • template