Files
fish-config/functions/ld.fish
T
rootiest 71574b5030 feat(help): header-driven --help for listing presets
lD, lsr, lss, lstree, lt, ltr, lx and ld. None shadows a real binary, so
there is no disabled-fallback contract to honour, and `eza --help`
documented eza rather than the preset that is these functions' entire
content. First-arg-only interception leaves `lt -la --help` passing
through to eza untouched.
2026-09-07 20:05:15 -04:00

37 lines
989 B
Fish

# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
# CATEGORY
# 14-miscellaneous
#
# SYNOPSIS
# ld
#
# DESCRIPTION
# Launches lazydocker targeting the currently active Docker context by
# resolving the host endpoint from docker context inspect.
#
# EXIT STATUS
# 1 docker or lazydocker is not installed
#
# EXAMPLE
# ld
function ld --description 'Run lazydocker on the current Docker context'
__fish_help_header (status current-function) $argv; and return 0
if not type -q docker
echo "ld: docker is not installed" >&2
return 1
end
if not type -q lazydocker
echo "ld: lazydocker is not installed" >&2
return 1
end
# Fetch the host endpoint of the currently active Docker context
set -l current_host (docker context inspect --format '{{.Endpoints.docker.Host}}')
# Run lazydocker with the DOCKER_HOST variable set for this command only
env DOCKER_HOST=$current_host lazydocker
end