@@ -19,7 +19,7 @@ use hgrep::bat::BatPrinter;
19
19
#[ cfg( feature = "syntect-printer" ) ]
20
20
use hgrep:: syntect:: SyntectPrinter ;
21
21
22
- const COMPLETION_SHELLS : [ & str ; 5 ] = [ "bash" , "zsh" , "powershell" , "fish" , "elvish" ] ;
22
+ const COMPLETION_SHELLS : [ & str ; 6 ] = [ "bash" , "zsh" , "powershell" , "fish" , "elvish" , "nushell "] ;
23
23
24
24
fn command ( ) -> Command {
25
25
#[ cfg( feature = "syntect-printer" ) ]
@@ -381,6 +381,7 @@ fn command() -> Command {
381
381
fn generate_completion_script < W : io:: Write > ( shell : & str , out : & mut W ) {
382
382
use clap_complete:: generate;
383
383
use clap_complete:: shells:: * ;
384
+ use clap_complete_nushell:: Nushell ;
384
385
385
386
let mut cmd = command ( ) ;
386
387
if shell. eq_ignore_ascii_case ( "bash" ) {
@@ -393,6 +394,8 @@ fn generate_completion_script<W: io::Write>(shell: &str, out: &mut W) {
393
394
generate ( Fish , & mut cmd, "hgrep" , out)
394
395
} else if shell. eq_ignore_ascii_case ( "elvish" ) {
395
396
generate ( Elvish , & mut cmd, "hgrep" , out)
397
+ } else if shell. eq_ignore_ascii_case ( "nushell" ) {
398
+ generate ( Nushell , & mut cmd, "hgrep" , out)
396
399
} else {
397
400
unreachable ! ( ) // SHELL argument was validated by clap
398
401
}
0 commit comments