Files
fish-config/functions/fish-deps.fish
T
rootiest e651566e14 docs(functions): split RETURNS into EXIT STATUS and stdout RETURNS
RETURNS previously conflated fish's $status exit code with genuine
stdout/printed output, e.g. rm listing "0/1" as if they were print
values rather than exit codes. Rename RETURNS to EXIT STATUS across
all 83 documented functions, and reintroduce RETURNS as a distinct
label reserved for the 15 functions that actually print to stdout.

Update build-manual.py's ENTRY_HEADS to render Exit Status before
Returns, manualtools.py's SECTIONS constant, and AGENTS.md's label
order and label-usage guidance to match. Add two verify-manual.py
regression tests: EXIT STATUS bodies must never contain stray
stdout/printed language, and Returns: must always render after
Exit Status: when both are present. Regenerate docs/fish-config.md.
2026-07-26 16:41:57 -04:00

93 lines
2.8 KiB
Fish

# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
# CATEGORY
# 06-dependency-management
#
# SYNOPSIS
# fish-deps [status|install|update|sync]
#
# DESCRIPTION
# Unified command for managing all tools this configuration depends on,
# dispatching to subcommand handlers. Defaults to status when no subcommand
# is given.
#
# Install method priority (highest to lowest):
# 1. git+cargo source build (fish shell itself)
# 2. cargo (Rust tools — gets latest crate version)
# 3. system PM (paru/apt/brew/etc.)
# 4. git clone (fzf)
# 5. curl installer (starship, fisher, uv)
#
# When multiple methods are available you are prompted to choose.
#
# Dependencies are grouped into three tiers:
#
# Required fish, fzf, zoxide
# Integrations wakatime, tailscale
# Recommended cargo, starship, uv, direnv, paru, yay, eza, lsd, bat,
# btop, dust, duf, prettyping, ov, ripgrep, lazygit,
# lazydocker, trash, kitty, wezterm, python3, yt-dlp
#
# ARGUMENTS
# status Report installed/missing deps (default)
# install Install missing deps interactively
# update Update all installed deps
# sync Install missing deps, then update all
#
# EXIT STATUS
# 0 Subcommand completed
# 1 Unknown subcommand
#
# EXAMPLE
# fish-deps sync
# fish-deps
# fish-deps install
# fish-deps update
function fish-deps --description 'Manage fish shell dependencies'
set -l subcmd $argv[1]
switch $subcmd
case status ''
_fish_deps_status
case install
_fish_deps_install
case update
_fish_deps_update
case sync
echo "=== Installing missing deps ==="
_fish_deps_install
echo ""
echo "=== Updating installed deps ==="
_fish_deps_update
case '*'
set_color red
echo "Unknown subcommand: $subcmd"
set_color normal
echo ""
__fish_deps_help
return 1
end
end
# SYNOPSIS
# __fish_deps_help
#
# DESCRIPTION
# Prints usage and subcommand reference for the fish-deps command to stdout.
#
# EXAMPLE
# __fish_deps_help
function __fish_deps_help
set_color cyan; echo "fish-deps — manage fish shell dependencies"; set_color normal
echo ""
echo "Usage:"
echo " fish-deps [status] Check installed/missing deps (default)"
echo " fish-deps install Install missing deps interactively"
echo " fish-deps update Update all installed deps"
echo " fish-deps sync Install missing, then update all"
echo ""
echo "Install method priority: cargo > system PM > git/curl/pipx"
echo "When multiple methods are available, you will be prompted to choose."
end