docs(functions): merge manual-only examples and notes into headers
Folds the examples Section 5 carried but the headers did not into each function's `# EXAMPLE`, and moves the three lines that only looked like examples -- the two typo-abbreviation notes and rm's /usr/bin/rm fallback -- into `# NOTES`, the label already in use. Also corrects gi's synopsis, which omitted -l, and documents yt-dlp's --no-embed-thumbnail in `# ARGUMENTS`.
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
#
|
#
|
||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# bd-pull myuser/myproject
|
# bd-pull myuser/myproject
|
||||||
|
# bd-pull rootiest/fish-config
|
||||||
function bd-pull --description 'Pull new Gitea issues into local Beads and link them'
|
function bd-pull --description 'Pull new Gitea issues into local Beads and link them'
|
||||||
if not set -q argv[1]; echo "Need repo owner/name"; return 1; end
|
if not set -q argv[1]; echo "Need repo owner/name"; return 1; end
|
||||||
if not set -q GITEA_TOKEN; echo "\$GITEA_TOKEN not set"; return 1; end
|
if not set -q GITEA_TOKEN; echo "\$GITEA_TOKEN not set"; return 1; end
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#
|
#
|
||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# cat README.md
|
# cat README.md
|
||||||
|
# cat ~/projects/myapp
|
||||||
function cat --wraps='bat' --description 'Use bat for files, ls for directories, and raw cat for ANSI logs'
|
function cat --wraps='bat' --description 'Use bat for files, ls for directories, and raw cat for ANSI logs'
|
||||||
# Opinionated guard (C1): fall back to bare command cat when disabled.
|
# Opinionated guard (C1): fall back to bare command cat when disabled.
|
||||||
if not __fish_config_op_enabled __fish_config_op_aliases
|
if not __fish_config_op_enabled __fish_config_op_aliases
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#
|
#
|
||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# cheat tar
|
# cheat tar
|
||||||
|
# cheat git
|
||||||
function cheat --wraps='cheat' --description 'alias cheat=cheat -c'
|
function cheat --wraps='cheat' --description 'alias cheat=cheat -c'
|
||||||
if type -q cheat
|
if type -q cheat
|
||||||
command cheat -c $argv
|
command cheat -c $argv
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
# config-help --man
|
# config-help --man
|
||||||
# config-help keys --man
|
# config-help keys --man
|
||||||
# config-help --help
|
# config-help --help
|
||||||
|
# config-help pkg --man
|
||||||
#
|
#
|
||||||
# NOTES
|
# NOTES
|
||||||
# The preferred invocation is `help config [...]` — this function is
|
# The preferred invocation is `help config [...]` — this function is
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#
|
#
|
||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# copy ./mydir/ ~/backup
|
# copy ./mydir/ ~/backup
|
||||||
|
# copy ./mydir/ ~/backup # copies mydir INTO backup, not backup/mydir/
|
||||||
function copy
|
function copy
|
||||||
set count (count $argv)
|
set count (count $argv)
|
||||||
if test "$count" = 2; and test -d "$argv[1]"
|
if test "$count" = 2; and test -d "$argv[1]"
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#
|
#
|
||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# dng2avif photo.dng
|
# dng2avif photo.dng
|
||||||
|
# dng2avif -q 85 -s 5 -i shot.dng -o out.avif
|
||||||
function dng2avif --description 'Convert DNG raw to 10-bit HDR AVIF'
|
function dng2avif --description 'Convert DNG raw to 10-bit HDR AVIF'
|
||||||
set -l options (fish_opt -s h -l help)
|
set -l options (fish_opt -s h -l help)
|
||||||
set -a options (fish_opt -s i -l input -r)
|
set -a options (fish_opt -s i -l input -r)
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#
|
#
|
||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# du ~/Downloads
|
# du ~/Downloads
|
||||||
|
# du --disk
|
||||||
function du --description 'Execute du'
|
function du --description 'Execute du'
|
||||||
# Opinionated guard (C1): fall back to bare command du when disabled.
|
# Opinionated guard (C1): fall back to bare command du when disabled.
|
||||||
if not __fish_config_op_enabled __fish_config_op_aliases
|
if not __fish_config_op_enabled __fish_config_op_aliases
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#
|
#
|
||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# dusize ~/Downloads
|
# dusize ~/Downloads
|
||||||
|
# dusize ~/Videos
|
||||||
function dusize --wraps='du' --description 'alias dusize=du'
|
function dusize --wraps='du' --description 'alias dusize=du'
|
||||||
du -sh (test -n "$argv[1]"; and echo $argv[1]; or echo .)
|
du -sh (test -n "$argv[1]"; and echo $argv[1]; or echo .)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -41,6 +41,8 @@
|
|||||||
# edit --terminal --new todo.md
|
# edit --terminal --new todo.md
|
||||||
# edit --editor=code --clipboard
|
# edit --editor=code --clipboard
|
||||||
# edit --text="hello world"
|
# edit --text="hello world"
|
||||||
|
# edit ~/.config/fish/config.fish
|
||||||
|
# edit --visual notes.txt
|
||||||
function edit --description 'Open files in a terminal or GUI editor with fallbacks'
|
function edit --description 'Open files in a terminal or GUI editor with fallbacks'
|
||||||
set -l c_head (set_color --bold cyan)
|
set -l c_head (set_color --bold cyan)
|
||||||
set -l c_cmd (set_color --bold white)
|
set -l c_cmd (set_color --bold white)
|
||||||
|
|||||||
@@ -23,6 +23,9 @@
|
|||||||
#
|
#
|
||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# fish-deps sync
|
# fish-deps sync
|
||||||
|
# fish-deps
|
||||||
|
# fish-deps install
|
||||||
|
# fish-deps update
|
||||||
function fish-deps --description 'Manage fish shell dependencies'
|
function fish-deps --description 'Manage fish shell dependencies'
|
||||||
set -l subcmd $argv[1]
|
set -l subcmd $argv[1]
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -5,7 +5,7 @@
|
|||||||
# 04-git-and-version-control
|
# 04-git-and-version-control
|
||||||
#
|
#
|
||||||
# SYNOPSIS
|
# SYNOPSIS
|
||||||
# gi [-h] [-b] [-p] [-s] [targets...]
|
# gi [-h] [-b] [-p] [-s] [-l] [targets...]
|
||||||
#
|
#
|
||||||
# DESCRIPTION
|
# DESCRIPTION
|
||||||
# Generates .gitignore content by querying the gitignore.io API. Appends
|
# Generates .gitignore content by querying the gitignore.io API. Appends
|
||||||
@@ -27,6 +27,8 @@
|
|||||||
#
|
#
|
||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# gi python,venv
|
# gi python,venv
|
||||||
|
# gi -b -p
|
||||||
|
# gi -s node > .gitignore
|
||||||
function gi --description 'Generate .gitignore files using the gitignore.io API'
|
function gi --description 'Generate .gitignore files using the gitignore.io API'
|
||||||
argparse h/help d/description l/list b/boilerplate p/prompt s/stdout -- $argv
|
argparse h/help d/description l/list b/boilerplate p/prompt s/stdout -- $argv
|
||||||
or return 1
|
or return 1
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#
|
#
|
||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# git-clean --force
|
# git-clean --force
|
||||||
|
# git-clean
|
||||||
function git-clean --description 'Sync main, prune remotes, and delete orphaned branches'
|
function git-clean --description 'Sync main, prune remotes, and delete orphaned branches'
|
||||||
set -l options h/help f/force
|
set -l options h/help f/force
|
||||||
argparse $options -- $argv
|
argparse $options -- $argv
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
#
|
#
|
||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# logs -c paru
|
# logs -c paru
|
||||||
|
# logs
|
||||||
|
# logs -c scrollback
|
||||||
function logs --description 'Browse terminal log files interactively with fzf'
|
function logs --description 'Browse terminal log files interactively with fzf'
|
||||||
# Opinionated guard (C4): integrations disabled
|
# Opinionated guard (C4): integrations disabled
|
||||||
if not __fish_config_op_enabled __fish_config_op_integrations
|
if not __fish_config_op_enabled __fish_config_op_integrations
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
#
|
#
|
||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# ls ~/projects
|
# ls ~/projects
|
||||||
|
# ls
|
||||||
|
# ls -a ~/projects
|
||||||
function ls --description 'List all files'
|
function ls --description 'List all files'
|
||||||
# Opinionated guard (C1): fall back to bare command ls when disabled.
|
# Opinionated guard (C1): fall back to bare command ls when disabled.
|
||||||
if not __fish_config_op_enabled __fish_config_op_aliases
|
if not __fish_config_op_enabled __fish_config_op_aliases
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#
|
#
|
||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# mkcd ~/projects/myapp
|
# mkcd ~/projects/myapp
|
||||||
|
# mkcd ~/projects/newapp/src
|
||||||
function mkcd --description 'Create a directory (with parents) and cd into it'
|
function mkcd --description 'Create a directory (with parents) and cd into it'
|
||||||
set -l c_head (set_color --bold cyan)
|
set -l c_head (set_color --bold cyan)
|
||||||
set -l c_cmd (set_color --bold white)
|
set -l c_cmd (set_color --bold white)
|
||||||
|
|||||||
@@ -36,6 +36,9 @@
|
|||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# open-url https://git.rootiest.dev/rootiest/fish-config
|
# open-url https://git.rootiest.dev/rootiest/fish-config
|
||||||
# open-url -v https://fish-config-docs.pages.dev/
|
# open-url -v https://fish-config-docs.pages.dev/
|
||||||
|
#
|
||||||
|
# NOTES
|
||||||
|
# Typo abbreviation: url-open (expands to open-url on space/enter).
|
||||||
function open-url --description 'Open a URL in the best available web browser'
|
function open-url --description 'Open a URL in the best available web browser'
|
||||||
argparse h/help s/silent v/verbose -- $argv
|
argparse h/help s/silent v/verbose -- $argv
|
||||||
or return 1
|
or return 1
|
||||||
|
|||||||
@@ -42,6 +42,12 @@
|
|||||||
# repo-open # open current branch (+ subdir) in browser
|
# repo-open # open current branch (+ subdir) in browser
|
||||||
# repo-open --print # just print the URL
|
# repo-open --print # just print the URL
|
||||||
# repo-open --root # repo home page for the current branch
|
# repo-open --root # repo home page for the current branch
|
||||||
|
# repo-open
|
||||||
|
# repo-open --print
|
||||||
|
# repo-open --root
|
||||||
|
#
|
||||||
|
# NOTES
|
||||||
|
# Typo abbreviation: open-repo (expands to repo-open on space/enter).
|
||||||
function repo-open --description 'Open the origin remote of the current repo in a browser'
|
function repo-open --description 'Open the origin remote of the current repo in a browser'
|
||||||
argparse -X 0 h/help p/print r/root -- $argv
|
argparse -X 0 h/help p/print r/root -- $argv
|
||||||
or return 1
|
or return 1
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
#
|
#
|
||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# rg "TODO" src/
|
# rg "TODO" src/
|
||||||
|
# rg "fish_greeting" ~/.config/fish/
|
||||||
|
# rg -l "TODO" ~/projects/myapp
|
||||||
function rg --description 'alias rg=rg --hyperlink-format=kitty'
|
function rg --description 'alias rg=rg --hyperlink-format=kitty'
|
||||||
# Opinionated guard (C1): fall back to bare command rg when disabled.
|
# Opinionated guard (C1): fall back to bare command rg when disabled.
|
||||||
if not __fish_config_op_enabled __fish_config_op_aliases
|
if not __fish_config_op_enabled __fish_config_op_aliases
|
||||||
|
|||||||
@@ -33,6 +33,9 @@
|
|||||||
# rm file.txt
|
# rm file.txt
|
||||||
# rm -e
|
# rm -e
|
||||||
# rm -S sensitive_key.pem
|
# rm -S sensitive_key.pem
|
||||||
|
#
|
||||||
|
# NOTES
|
||||||
|
# Falls back to /usr/bin/rm when trash is unavailable.
|
||||||
function rm --description 'Ultimate rm: trash, list, empty, and secure-erase'
|
function rm --description 'Ultimate rm: trash, list, empty, and secure-erase'
|
||||||
# Opinionated guard (C1): fall back to bare command rm when disabled.
|
# Opinionated guard (C1): fall back to bare command rm when disabled.
|
||||||
if not __fish_config_op_enabled __fish_config_op_aliases
|
if not __fish_config_op_enabled __fish_config_op_aliases
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# spark 1 1 2 5 14 42
|
# spark 1 1 2 5 14 42
|
||||||
# seq 64 | sort --random-sort | spark
|
# seq 64 | sort --random-sort | spark
|
||||||
|
# echo "3 7 2 9 1" | spark
|
||||||
function spark --description 'Sparklines'
|
function spark --description 'Sparklines'
|
||||||
argparse --ignore-unknown --name=spark v/version h/help m/min= M/max= -- $argv || return
|
argparse --ignore-unknown --name=spark v/version h/help m/min= M/max= -- $argv || return
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,8 @@
|
|||||||
#
|
#
|
||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# y "hello world"
|
# y "hello world"
|
||||||
|
# ls | y
|
||||||
|
# cat file.txt | y
|
||||||
function y --description 'Yank to clipboard'
|
function y --description 'Yank to clipboard'
|
||||||
# Check for help flag
|
# Check for help flag
|
||||||
if contains -- -h $argv; or contains -- --help $argv
|
if contains -- -h $argv; or contains -- --help $argv
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#
|
#
|
||||||
# ARGUMENTS
|
# ARGUMENTS
|
||||||
# args... Arguments forwarded to yt-dlp (defaults prepended)
|
# args... Arguments forwarded to yt-dlp (defaults prepended)
|
||||||
|
# --no-embed-thumbnail Skip thumbnail embedding for this run
|
||||||
#
|
#
|
||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# yt-dlp dQw4w9WgXcQ
|
# yt-dlp dQw4w9WgXcQ
|
||||||
|
|||||||
Reference in New Issue
Block a user