Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 05e1880

Browse files
fix: shell detection message always outputed when generating completion (#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)

AltStyle によって変換されたページ (->オリジナル) /