Skip to content

Commit 05e1880

Browse files
authored
fix: shell detection message always outputed when generating completion (clearloop#131)
* fix: shell detection message always outputed when generating completion * Remove shell detection message * Update README
1 parent 0322356 commit 05e1880

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ You may also obtain specific shell configuration using.
3737
leetcode completions fish
3838
```
3939

40+
If no argument is provided, the shell is inferred from the `SHELL` environment variable.
41+
4042
</details>
4143

4244
## Usage

src/cmds/completions.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@ fn get_completions_string<G: Generator>(gen: G, cmd: &mut ClapCommand) -> Result
5151
pub fn completion_handler(m: &ArgMatches, cmd: &mut ClapCommand) -> Result<(), Error> {
5252
let shell = *m.get_one::<Shell>("shell").unwrap_or(
5353
// if shell value is not provided try to get from the environment
54-
{
55-
println!("# Since shell arg value is not provided trying to get the default shell from the environment.");
56-
&Shell::from_env().ok_or(Error::MatchError)?
57-
}
54+
&Shell::from_env().ok_or(Error::MatchError)?,
5855
);
5956
let completions = get_completions_string(shell, cmd)?;
6057
println!("{}", completions);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy