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

Wrong parameter parsing. #44

Closed
goldragoon opened this issue May 3, 2018 · 1 comment · Fixed by #82
Closed

Wrong parameter parsing. #44

goldragoon opened this issue May 3, 2018 · 1 comment · Fixed by #82
Assignees
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@goldragoon
Copy link

Obiviously, as depicted below, bat command recognizes filename (R-language source code) as subcommand.

If this error doesn't come from my misuse, i'll fix it.

2018-05-03 9 43 18

@sharkdp sharkdp added the bug Something isn't working label May 3, 2018
@sharkdp
Copy link
Owner

sharkdp commented May 3, 2018

Oh, I guess I shouldn't have mixed positional arguments and sub-commands. That was a bad idea. Thank you for reporting this.

The problem seems to be with the help subcommand that clap enables as soon as we have at least one subcommand (init-cache). clap seems to think that you wanted to call bat help due to the name of the file (triggered by any file named hel...). Similar problems occur with files named (ini...). We should get rid of the subcommands and turn init-cache into a command-line option.

@sharkdp sharkdp added the good first issue Good for newcomers label May 3, 2018
@sharkdp sharkdp added this to the 0.3 milestone May 6, 2018
@sharkdp sharkdp self-assigned this May 6, 2018
sharkdp added a commit that referenced this issue May 8, 2018
* Remove the old `init-cache` subcommand

* Introduce a new `cache` subcommand that can be used like this:

    * `bat cache -h` - Show help
    * `bat cache --init` - Initialize cache from config dir
    * `bat cache --clear` - Reset the cache
    * `bat cache --config-dir` - Show config directory

* Update README

closes #44
sharkdp added a commit that referenced this issue May 8, 2018
* Remove the old `init-cache` subcommand

* Introduce a new `cache` subcommand that can be used like this:

    * `bat cache -h` - Show help
    * `bat cache --init` - Initialize cache from config dir
    * `bat cache --clear` - Reset the cache
    * `bat cache --config-dir` - Show config directory

* Update README

closes #44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants