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

Confusing doc / error #195

Open
chevdor opened this issue Jul 2, 2021 · 6 comments
Open

Confusing doc / error #195

chevdor opened this issue Jul 2, 2021 · 6 comments
Labels

Comments

@chevdor
Copy link
Contributor

chevdor commented Jul 2, 2021

fw add --help                                                          
fw-add 
Add project to config

USAGE:
    fw add [OPTIONS] <URL> [--] [NAME]

...

then:

fw add -t rust [email protected]:chevdor/fw.git
error: The following required arguments were not provided:
    <URL>

USAGE:
    fw add <URL> --tag <tag>...

The 2 doc don't agree with each other.

@bomgar
Copy link
Member

bomgar commented Jul 2, 2021

I stumbled on this a while ago.
https://github.com/brocode/fw/blob/master/src/app/mod.rs#L164 the issue is probably the index here.
I didn't have the time to analyze this further.

@bomgar bomgar added the bug label Jul 2, 2021
@chevdor
Copy link
Contributor Author

chevdor commented Jul 2, 2021

No stress, I may look into this eventually, I noticed that following the doc did not behave as intended. I guess something changed and the doc was not updated.

@chevdor
Copy link
Contributor Author

chevdor commented Jul 2, 2021

So the right syntax as currently implemented is:

fw add <URL> [NAME] [-t ... ]  

The usage fw add [OPTIONS] <URL> [--] [NAME] is wrong.

@bomgar
Copy link
Member

bomgar commented Jul 2, 2021

The library generates the help and the parser. So either we are doing something wrong using it or the lib has bug.

@chevdor
Copy link
Contributor Author

chevdor commented Jul 2, 2021

I will have a look, I just wanted to document what I briefly checked to at least know how it works as I ended up with git urls as tags 😄

@chevdor
Copy link
Contributor Author

chevdor commented Jul 19, 2021

I had a look and I think the code as it is is OK.
clap gets lots if the options such as -t rust are provided before the URL.
It would be interesting to see whether clap 3 handles this better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants