Personal Nix flake
nixos home-manager nix
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: Migrate to nushell's directive for wrapped command completions

All commands now use the new `@complete external`

+4 -19
+4 -19
nix/home/modules/cli/nushell/commands.nu
··· 1 1 # Wrapper for git branch 2 + @complete external 2 3 def --wrapped "git branch" [ 3 - ...rest: string@__git_branch_completions, 4 + ...rest: string, 4 5 ] { 5 6 ^git branch ...$rest 6 7 | lines ··· 10 11 } 11 12 } 12 13 13 - def __git_branch_completions [] { 14 - __get_completions git branch 15 - } 16 - 17 14 # Nushell-friendly fzf wrapper 18 15 # 19 16 # Supports plain lists and tables with optional cell path 17 + @complete external 20 18 def --wrapped fzf [ 21 19 --path: cell-path, # The cell path to use for the description 22 - ...rest: string@__fzf_completions, 20 + ...rest: string, 23 21 ]: list -> list { 24 22 let input = $in; 25 23 let hasPath = $path != null ··· 42 40 | each { |index| $input | get $index } 43 41 } 44 42 45 - def __fzf_completions [] { 46 - __get_completions fzf 47 - } 48 - 49 43 # Cast to list, for e.g. ranges 50 44 def "into list" []: any -> list<any> { 51 45 each {} 52 46 } 53 - 54 - # Helper to generate completion functions 55 - def __get_completions [ 56 - command: string, 57 - ...context: string, 58 - ] { 59 - ^carapace $command nushell $command ...$context '-' 60 - | from json 61 - }