diff --git a/README.md b/README.md index c80ae9d..6d16aa0 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,8 @@ You may also obtain specific shell configuration using. leetcode completions fish ``` +If no argument is provided, the shell is inferred from the `SHELL` environment variable. + ## Usage diff --git a/src/cmds/completions.rs b/src/cmds/completions.rs index c57c543..bc675de 100644 --- a/src/cmds/completions.rs +++ b/src/cmds/completions.rs @@ -51,10 +51,7 @@ fn get_completions_string(gen: G, cmd: &mut ClapCommand) -> Result pub fn completion_handler(m: &ArgMatches, cmd: &mut ClapCommand) -> Result<(), Error> { let shell = *m.get_one::("shell").unwrap_or( // if shell value is not provided try to get from the environment - { - println!("# Since shell arg value is not provided trying to get the default shell from the environment."); - &Shell::from_env().ok_or(Error::MatchError)? - } + &Shell::from_env().ok_or(Error::MatchError)?, ); let completions = get_completions_string(shell, cmd)?; println!("{}", completions);