mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-08-25 20:43:56 +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 -*-
|
||||
# argx & lg is required by the kubernetes module
|
||||
use modules/argx *
|
||||
use modules/lg *
|
||||
# NOTE: use a prefixed import (not `*`), otherwise argx's `parse` command
|
||||
# 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,
|
||||
use modules/kubernetes *
|
||||
# a wrapper around the jc cli tool, convert cli outputs to nushell tables
|
||||
|
||||
Reference in New Issue
Block a user