Files
fish-config/functions/less.fish
T
Claude fceddfc43f docs: add DEPENDENCIES sections to function doc headers
Documents what each function needs for full functionality -- other
repo functions it calls, and external CLI tools it uses or falls
back gracefully without (e.g. rm/trash, ls/eza+lsd) -- matching the
existing CLASSIFICATION convention's placement and the ~20 functions
that already carried this label.

Also broadens verify-manual.py's dependency-resolution check to
recognize this repo's other existence-check idioms (command -q,
command -v, which -- not just type -q) and dng2avif's dynamic
type -q $cmd loop, since several genuine dependencies (eza, lsd,
fastfetch, fd, ps, ...) are only ever guarded that way.
2026-09-22 22:22:27 -04:00

47 lines
1.0 KiB
Fish

# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
# CATEGORY
# 03-editors-and-viewers
#
# COMPONENT
# aliases/shell-tools
#
# DEPENDENCIES
# ov, more
#
# CLASSIFICATION
# bypasses-shadow(cat,less)
#
# SYNOPSIS
# less [args...]
#
# DESCRIPTION
# Pager wrapper that tries $PAGER, then ov, then less, then more, then cat
# as fallbacks in that order.
#
# ARGUMENTS
# args... Files or options forwarded to the pager
#
# EXAMPLE
# less /var/log/syslog
function less --wraps='ov' --description 'Pager wrapper: $PAGER → ov → less → more → cat'
# Opinionated guard (C1): fall back to bare command less when disabled.
if not __fish_config_op_enabled (status current-function)
command less $argv
return $status
end
if set -q PAGER; and command -q $PAGER
command $PAGER $argv
else if command -q ov
command ov $argv
else if command -q less
command less $argv
else if command -q more
command more $argv
else
command cat $argv
end
end