Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(complete): support the shell being specified with an absolute path #4730

Closed
wants to merge 1 commit into from
Closed

fix(complete): support the shell being specified with an absolute path #4730

wants to merge 1 commit into from

Conversation

steven-joruk
Copy link

@steven-joruk steven-joruk commented Feb 26, 2023

This was failing because my SHELL is an absolute path. I know I can just SHELL=zsh ./x but I expect people would prefer to just be able to rely on their existing SHELL value.

error: invalid value '/usr/bin/zsh' for '<SHELL>'
  [possible values: bash, elvish, fish, powershell, zsh]

For more information, try '--help'.
use clap::{arg, Parser};
use clap_complete::Shell;

#[derive(Parser)]
struct Args {
    #[arg(env)]
    shell: Shell,
}

fn main() {
    Args::parse();
}

Absolute paths are sometimes used in the SHELL environment variable.
@epage
Copy link
Member

epage commented Feb 27, 2023

Shell is meant to be used as the name of the shell and not to be directly compatible with $SHELL. #4447 is one change made to help when processing $SHELL.

@epage epage closed this Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants