diff options
| author | Danilo M. <danix@danix.xyz> | 2026-07-05 20:48:06 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-07-05 20:48:06 +0200 |
| commit | b873c5f2394fed0750c35a239d34ce531d3efcdf (patch) | |
| tree | eb3da2d717ebd34c2081cf124a73ff53adfd33fe | |
| parent | 176c7560b21a92fa3007b69847ff253f7d7af9ad (diff) | |
| download | mkhintfile-b873c5f2394fed0750c35a239d34ce531d3efcdf.tar.gz mkhintfile-b873c5f2394fed0750c35a239d34ce531d3efcdf.zip | |
feat: compact --help, move reference to man page
Trim show_help to a usage synopsis, the options list, the runtime
paths, and a 'man mkhint' pointer. The usage examples, variable-order
note, and exit-code table now live in the man page. Add T73 asserting
--help exits 0 and points at the man page.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| -rwxr-xr-x | mkhint | 25 | ||||
| -rwxr-xr-x | tests/mkhint_test.sh | 11 |
2 files changed, 13 insertions, 23 deletions
@@ -59,20 +59,7 @@ show_help() { cat <<EOF mkhint $MKHINT_VERSION - Manage hint files for slackrepo scripts -Usage: - ./mkhint --set-version VERSION --hintfile FILE Update existing hint file - ./mkhint --set-version VERSION --new FILE Create new hint file - ./mkhint --new FILE Create new hint file (no version) - ./mkhint --hintfile FILE Update hint, suggest latest version via nvchecker - ./mkhint --check [FILE...] Check all (or named) hints for upstream updates - ./mkhint --fix-current Sweep repo, add DELREQUIRES for -current phantom deps - ./mkhint --list List hint files - ./mkhint --review Review hints matching SBo version, keep/delete each - ./mkhint --review FILE... Review named hints (any version), keep/delete each - ./mkhint --clean Remove .bak files from HINT_DIR - ./mkhint --no-dl --hintfile FILE Update hint, skip downloads, add NODOWNLOAD=yes - ./mkhint --no-dl --new FILE Create hint with NODOWNLOAD=yes - ./mkhint --help Show this help +Usage: mkhint [OPTION] [FILE...] Options: --version, -v Print version and exit @@ -93,15 +80,7 @@ Hint files are stored in: $HINT_DIR Temporary files are stored in: $TMP_DIR Phantom-dep list (for --fix-current / --new): $PHANTOM_DEPS_FILE -Variables order in hint files: - VERSION, ARCH, DOWNLOAD, MD5SUM, DOWNLOAD_x86_64, MD5SUM_x86_64 - -Exit codes: - 0 - Success - 1 - Invalid arguments or missing required options - 2 - File not found - 3 - File already exists - 4 - required tool not available (wget / nvchecker / nvtake / jq) +See 'man mkhint' for usage examples, configuration, and exit codes. EOF } diff --git a/tests/mkhint_test.sh b/tests/mkhint_test.sh index 630c140..ff8bffc 100755 --- a/tests/mkhint_test.sh +++ b/tests/mkhint_test.sh @@ -1402,6 +1402,17 @@ run_mkhint -C curl < <(printf 'Y\nY\n') assert_contains "override tree → update" "$SLACKREPO_LOG" '^update curl$' rm -f "$MOCK_BASE/config" +# ── T73: --help compact, exits 0, points at man page ───────────────────────── +echo "" +echo "T73: --help exits 0 and points at 'man mkhint'" +set +e +out=$(run_mkhint --help 2>&1); code=$? +set -e +assert_exit_code "--help exits 0" 0 "$code" +echo "$out" | grep -q 'man mkhint' \ + && { echo " PASS: --help points at man page"; (( PASS++ )); } \ + || { echo " FAIL: --help missing man pointer: $out"; (( FAIL++ )); ERRORS+=("T73 pointer"); } + # ─── SUMMARY ────────────────────────────────────────────────────────────────── teardown |
