e651566e14
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.
54 lines
1.8 KiB
Fish
54 lines
1.8 KiB
Fish
# Copyright (C) 2026 Rootiest
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
# SYNOPSIS
|
|
# __fish_user_dots_link
|
|
#
|
|
# DESCRIPTION
|
|
# Manages the git-ignored `user-dots` convenience symlink in the fish config
|
|
# directory ($__fish_config_dir/user-dots), pointing it at the resolved
|
|
# $__fish_user_dots_path so the private overlay can be browsed from
|
|
# ~/.config/fish/.
|
|
#
|
|
# Behaviour is controlled by the __fish_user_dots_symlink toggle:
|
|
# - explicit falsy (0/false/…) — remove our symlink if present and stop.
|
|
# Honoured regardless of C2, so opting out always cleans up.
|
|
# - unset or truthy (default) — create the link if missing and repoint it
|
|
# if the target changed. This is a C2 startup side-effect, so it only
|
|
# creates when __fish_config_op_autoexec is enabled.
|
|
#
|
|
# Only ever manages a symlink; a real file or directory at that path is left
|
|
# untouched.
|
|
#
|
|
# ARGUMENTS
|
|
# (none)
|
|
#
|
|
# EXIT STATUS
|
|
# 0 Always
|
|
#
|
|
# EXAMPLE
|
|
# __fish_user_dots_link
|
|
function __fish_user_dots_link --description 'Manage the user-dots convenience symlink'
|
|
set -l link "$__fish_config_dir/user-dots"
|
|
set -q __fish_user_dots_path
|
|
or set -l __fish_user_dots_path "$XDG_CONFIG_HOME/.user-dots/fish"
|
|
|
|
# Explicit opt-out: remove our symlink (never a real file/dir) and stop.
|
|
__fish_variable_check __fish_user_dots_symlink
|
|
if test $status -eq 1
|
|
test -L "$link"; and rm -f "$link"
|
|
return 0
|
|
end
|
|
|
|
# Enabled: creation is a C2 startup side-effect.
|
|
__fish_config_op_enabled __fish_config_op_autoexec; or return 0
|
|
|
|
test -d "$__fish_user_dots_path"; or return 0
|
|
if test -L "$link"
|
|
test (readlink "$link") != "$__fish_user_dots_path"
|
|
and ln -sfn "$__fish_user_dots_path" "$link"
|
|
else if not test -e "$link"
|
|
ln -s "$__fish_user_dots_path" "$link"
|
|
end
|
|
end
|