feat(config-help): add --html and --man flags; add config-update function #36

Merged
rootiest merged 1 commits from feat/config-help-flags-and-updater into main 2026-06-08 19:30:53 +00:00
Owner

Summary

  • config-help --html / -w: opens docs/html/index.html in the default browser using smart browser detection — queries the x-scheme-handler/https MIME entry via xdg-mime to find the real browser binary, falls back through known binaries (firefox, chromium, vivaldi, etc.), then xdg-open as last resort. Bypasses xdg-open's text/html MIME lookup which could route to non-browser apps (e.g. ebook readers).
  • config-help --man / -m: opens the compiled docs/fish-config.1 man page directly via man -l, skipping the pager fallback chain.
  • config-update: new function that pulls the latest config from the hard-coded upstream URL (https://git.rootiest.dev/rootiest/fish-config.git) without requiring a configured git remote. Git output is suppressed; colored messages report fetch/merge status. Supports --dry-run (preview only) and --force (auto-stash local changes).
  • README: updated Offline Documentation table and added a new "Updating the Config" section.

Manual Verification

  • config-help --help shows --html and --man in USAGE, ARGUMENTS, and EXAMPLES
  • config-help --html prints "Opening HTML docs in <browser>…" and opens docs/html/index.html in a web browser (not an ebook reader)
  • config-help --man opens the fish-config man page in the terminal
  • config-help --man prints an error if docs/fish-config.1 is missing
  • config-update --dry-run fetches upstream and reports commits available without modifying anything
  • config-update (when already up to date) prints "✓ Already up to date."
  • config-update --force on a dirty tree stashes, pulls, and restores the stash
  • config-update on a dirty tree (without --force) warns and exits cleanly
## Summary - **`config-help --html` / `-w`**: opens `docs/html/index.html` in the default browser using smart browser detection — queries the `x-scheme-handler/https` MIME entry via `xdg-mime` to find the real browser binary, falls back through known binaries (firefox, chromium, vivaldi, etc.), then `xdg-open` as last resort. Bypasses `xdg-open`'s `text/html` MIME lookup which could route to non-browser apps (e.g. ebook readers). - **`config-help --man` / `-m`**: opens the compiled `docs/fish-config.1` man page directly via `man -l`, skipping the pager fallback chain. - **`config-update`**: new function that pulls the latest config from the hard-coded upstream URL (`https://git.rootiest.dev/rootiest/fish-config.git`) without requiring a configured git remote. Git output is suppressed; colored messages report fetch/merge status. Supports `--dry-run` (preview only) and `--force` (auto-stash local changes). - **README**: updated Offline Documentation table and added a new "Updating the Config" section. ## Manual Verification - [x] `config-help --help` shows `--html` and `--man` in USAGE, ARGUMENTS, and EXAMPLES - [x] `config-help --html` prints "Opening HTML docs in \<browser\>…" and opens `docs/html/index.html` in a web browser (not an ebook reader) - [x] `config-help --man` opens the fish-config man page in the terminal - [x] `config-help --man` prints an error if `docs/fish-config.1` is missing - [x] `config-update --dry-run` fetches upstream and reports commits available without modifying anything - [x] `config-update` (when already up to date) prints "✓ Already up to date." - [x] `config-update --force` on a dirty tree stashes, pulls, and restores the stash - [x] `config-update` on a dirty tree (without `--force`) warns and exits cleanly
rootiest added 1 commit 2026-06-08 19:30:04 +00:00
config-help gains two new flags:
- --html / -w: opens docs/html/index.html in the default browser using
  smart browser detection (xdg-mime https scheme handler → known binaries
  → xdg-open fallback) to avoid MIME-type mismatches with non-browser apps
- --man / -m: opens the compiled docs/fish-config.1 man page via man -l

config-update is a new function that pulls the latest fish config from the
hard-coded upstream URL without requiring a configured git remote. Suppresses
git output and reports status with colored messages. Supports --dry-run and
--force flags.

README updated to document all new commands.
rootiest force-pushed feat/config-help-flags-and-updater from 278dc6571c to de07040c16 2026-06-08 19:30:04 +00:00 Compare
rootiest merged commit bf2ad2f1e7 into main 2026-06-08 19:30:53 +00:00
rootiest deleted branch feat/config-help-flags-and-updater 2026-06-08 19:30:53 +00:00
Sign in to join this conversation.