Files
fish-config/functions/ping.fish
T
rootiest 1341e2559e docs(functions): standardize all function doc blocks to UNIX man-page style
Replace all ad-hoc inline comments between license headers and function
declarations with consistent SYNOPSIS / DESCRIPTION / ARGUMENTS / RETURNS /
EXAMPLE blocks across all 99 project-owned functions/ files. No executable
logic, variable names, or exit codes were modified.

Completes Task #6 from AGENTS.md (Retroactive Function Documentation
Standardization).
2026-06-05 20:18:49 -04:00

32 lines
919 B
Fish

# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
# 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'
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