4c51ef7a33
Records each documented function's manual category in its own header, so Section 5 can later be generated from source instead of hand-maintained alongside it. Values reproduce the current grouping in docs/manual/05-functions/ exactly; no documentation changes meaning here. Four functions are skipped because they have no header at all yet (branch, fc, gitup, sudo-toggle); they get one in the merge that follows.
41 lines
1.1 KiB
Fish
41 lines
1.1 KiB
Fish
# Copyright (C) 2026 Rootiest
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
# CATEGORY
|
|
# 10-network
|
|
#
|
|
# 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 __fish_config_op_aliases
|
|
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
|