feat(help): render --help from function headers; stop 8 functions executing on --help #132

Merged
rootiest merged 10 commits from feat/header-driven-help into main 2026-09-08 05:39:24 +00:00
7 changed files with 16 additions and 0 deletions
Showing only changes of commit 3d826c5407 - Show all commits
+2
View File
@@ -23,6 +23,8 @@
# EXAMPLE
# bkg firefox
function bkg --description 'Execute bkg'
__fish_help_header (status current-function) $argv; and return 0
# Check if a command was provided as an argument.
if test -z "$argv[1]"
set -l c_head (set_color --bold cyan)
+2
View File
@@ -24,6 +24,8 @@
# fc
# fc git
function fc --description 'Edit and execute the last command (Bash-style fc)'
__fish_help_header (status current-function) $argv; and return 0
set -l tmpfile (mktemp /tmp/fish_fc.XXXXXX).fish
if count $argv >/dev/null
+2
View File
@@ -17,6 +17,8 @@
# EXAMPLE
# hist
function hist --description 'Search fish history and put it in the prompt'
__fish_help_header (status current-function) $argv; and return 0
# Opinionated guard (C4): integrations disabled
if not __fish_config_op_enabled (status current-function)
set -l c_err (set_color red)
+4
View File
@@ -29,6 +29,10 @@
# split
# split -v nvim README.md
function split --description 'Run a command in a new terminal split'
# -h is --horizontal here (see this function's own ARGUMENTS),
# so only the long form may reach the renderer.
test "$argv[1]" = --help; and __fish_help_header (status current-function) --help; and return 0
# Opinionated guard (C4): integrations disabled
if not __fish_config_op_enabled (status current-function)
set -l c_err (set_color red)
+2
View File
@@ -24,6 +24,8 @@
# EXAMPLE
# spwin
function spwin --wraps='~/.config/kitty/spawn-window.sh' --description 'spawn window in kitty or wezterm'
__fish_help_header (status current-function) $argv; and return 0
# Opinionated guard (C4): integrations disabled
if not __fish_config_op_enabled (status current-function)
set -l c_err (set_color red)
+2
View File
@@ -25,6 +25,8 @@
# EXAMPLE
# tab
function tab --description 'Spawn a new tab in the current terminal'
__fish_help_header (status current-function) $argv; and return 0
# Opinionated guard (C4): integrations disabled
if not __fish_config_op_enabled (status current-function)
set -l c_err (set_color red)
+2
View File
@@ -22,6 +22,8 @@
# EXAMPLE
# wake-lock rsync -avz src/ dest/
function wake-lock --description 'Run a command while inhibiting system sleep'
__fish_help_header (status current-function) $argv; and return 0
if test (count $argv) -eq 0
set -l c_head (set_color --bold cyan)
set -l c_cmd (set_color --bold)