Skip to content

Commit e702d5a

Browse files
j-xellaalex
andauthored
Allow wildcard expansion in eza completions (#1165)
I noticed that when I copy `custom-completions/eza/eza-completions.nu` into my `autoload` dir, then wildcards don't work any more. For example, in a folder that contains nu scripts, the command ```nu eza *.nu ``` Produces an error `"*.nu" file not found` instead of listing all the nu scripts. The problem seems to be with `path?` argument. nushell does not expand wildcards for arguments of the `path` type and sends `*.nu` as is to the command. Moreover, `path` is only a single parameter, while eza can accept a list of file or folder arguments. --- For the reference, nushell own `ls -h` uses different argument type: ``` Parameters: ...pattern <oneof<glob, string>>: The glob pattern to use. ``` So, one solution could have been modifying the `path` argument to a similar signature. However, `export extern` seems to be doing something similar by default for all unspecified arguments anyway. So, a simpler solution is to get rid of the `path` argument altogether and rely on the default behaviour. Co-authored-by: alex <alex@main-dell>
1 parent 7c128b0 commit e702d5a

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

custom-completions/eza/eza-completions.nu

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ def "nu-complete eza color-scale-mode" [] {
4141
eza --long --tree --level=3
4242
}
4343
export extern "eza" [
44-
path?: path # folder to list
45-
4644
--help(-?) # show list of command-line options
4745
--version(-v) # show version of eza
4846

0 commit comments

Comments
 (0)