mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-08-26 13:04:01 +02:00
fix(nushell): import argx & lg with prefix to avoid shadowing builtins
`use modules/argx *` glob-imports argx's `parse` command into the global scope, shadowing nushell's builtin `parse`. Any script sourced afterwards that relies on the builtin (e.g. fzf's nushell integration, which uses `parse --regex`) then fails to parse with `unknown flag`. Use prefixed imports for `argx` and `lg` instead of `*`: both modules are still registered for the kubernetes module's submodules (which call `argx parse` / `lg level`), there are no bare `parse`/`main`/`level` call sites, and the builtin `parse` stays available.
This commit is contained in:
@@ -46,8 +46,11 @@
|
|||||||
|
|
||||||
# -*- modules -*-
|
# -*- modules -*-
|
||||||
# argx & lg is required by the kubernetes module
|
# argx & lg is required by the kubernetes module
|
||||||
use modules/argx *
|
# NOTE: use a prefixed import (not `*`), otherwise argx's `parse` command
|
||||||
use modules/lg *
|
# would shadow nushell's builtin `parse`, breaking scripts that rely on
|
||||||
|
# the builtin (e.g. fzf's nushell integration uses `parse --regex`)
|
||||||
|
use modules/argx
|
||||||
|
use modules/lg
|
||||||
# k8s/helm aliases, completions,
|
# k8s/helm aliases, completions,
|
||||||
use modules/kubernetes *
|
use modules/kubernetes *
|
||||||
# a wrapper around the jc cli tool, convert cli outputs to nushell tables
|
# a wrapper around the jc cli tool, convert cli outputs to nushell tables
|
||||||
|
|||||||
Reference in New Issue
Block a user