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

feat: Make eza fail when built with -git and the --git parameter is given in the command line #1019

Open
ericbn opened this issue Jun 10, 2024 · 3 comments

Comments

@ericbn
Copy link

ericbn commented Jun 10, 2024

Currently how would we test if an eza binary was built with -git (git feature disabled)?

I see this fails as expected:

❯ eza --git
eza: Options --git and --git-ignore can't be used because `git` feature was disabled in this build of exa

But not these:

❯ eza --git --help
...
❯ eza --git --version
...

(Although all the above always fail when an unknown parameter is given, like --gix)

Can we make eza always fail when the --git parameter is given and it was build with -git?

@daviessm
Copy link
Contributor

That's definitely one for after the clap integration, if that ever happens.

@ericbn
Copy link
Author

ericbn commented Jun 10, 2024

How do you suggest we check if the git feature is enabled? Maybe by calling eza --git /dev/null?

Example of a shell script:

if eza --git /dev/null &>/dev/null; then
  alias ll='eza -l --git'
else
  alias ll='eza -l'
fi

@alanatlab49
Copy link

How about don't fail, just ignore the option?

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

No branches or pull requests

3 participants