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.
50 lines
1.2 KiB
Fish
50 lines
1.2 KiB
Fish
# Copyright (C) 2026 Rootiest
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
# CATEGORY
|
|
# 10-network
|
|
#
|
|
# COMPONENT
|
|
# aliases/network
|
|
#
|
|
# DEPENDENCIES
|
|
# prettyping
|
|
#
|
|
# CLASSIFICATION
|
|
# bypasses-shadow(ping)
|
|
#
|
|
# SYNOPSIS
|
|
# ping [args...]
|
|
#
|
|
# DESCRIPTION
|
|
# Wraps prettyping with --nolegend by default for a cleaner display.
|
|
# Pass --legend to show the legend. Falls back to system ping if
|
|
# prettyping is not installed.
|
|
#
|
|
# ARGUMENTS
|
|
# --legend Show the prettyping legend (overrides default --nolegend)
|
|
# args... Arguments forwarded to prettyping or system ping
|
|
#
|
|
# EXAMPLE
|
|
# ping google.com
|
|
# ping --legend google.com
|
|
function ping --description 'prettyping with default nolegend'
|
|
# Opinionated guard (C1): fall back to bare command ping when disabled.
|
|
if not __fish_config_op_enabled (status current-function)
|
|
command ping $argv
|
|
return $status
|
|
end
|
|
|
|
if command -q prettyping
|
|
# Check if the user specifically asked for the legend
|
|
if contains -- --legend $argv
|
|
command prettyping $argv
|
|
else
|
|
command prettyping --nolegend $argv
|
|
end
|
|
else
|
|
# Fallback to standard ping if prettyping isn't installed
|
|
command ping $argv
|
|
end
|
|
end
|