From 0eb1aeb7e6613258067085c860d79e133cda4665 Mon Sep 17 00:00:00 2001 From: shuki Date: Sat, 7 Mar 2026 05:20:35 +0200 Subject: [PATCH] Split CLI help into short (--help) and full (--full-help/--docs) Short help shows a compact command list. Full help includes detailed usage for every command with descriptions and config paths. Co-Authored-By: Claude Opus 4.6 --- bin/gniza | 100 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 79 insertions(+), 21 deletions(-) diff --git a/bin/gniza b/bin/gniza index 60eccf3..06bb3df 100755 --- a/bin/gniza +++ b/bin/gniza @@ -38,7 +38,39 @@ Options: --cli Force CLI mode (no TUI) --debug Enable debug logging --config=FILE Override config file path - --help Show this help + --help Show this help (use --full-help for detailed docs) + --full-help Show full documentation + --version Show version + +Commands: + targets Manage sources (list, add, delete, show) + remotes Manage destinations (list, add, delete, show, test) + backup Run backup + restore Restore from a snapshot + snapshots List or browse snapshots + retention Enforce retention policies + schedule Manage cron schedules (install, show, remove) + logs View backup logs + web Web dashboard (start, install-service, status) + uninstall Uninstall gniza + +Run 'gniza --full-help' for detailed usage of all commands. +If no command is given, the TUI is launched. +EOF +} + +show_full_help() { + cat <.conf + Destinations: \$CONFIG_DIR/remotes.d/.conf + Schedules: \$CONFIG_DIR/schedules.d/.conf + Settings: \$CONFIG_DIR/gniza.conf + + Root mode: /etc/gniza/ + User mode: ~/.config/gniza/ If no command is given, the TUI is launched. EOF @@ -113,10 +167,14 @@ while [[ $# -gt 0 ]]; do CONFIG_FILE="${1#--config=}" shift ;; - --help) + --help|-h) show_help exit 0 ;; + --full-help|--docs) + show_full_help + exit 0 + ;; --version) echo "gniza v${GNIZA4LINUX_VERSION}" exit 0