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

allow parameters to be specified in any order #16

Open
javier-lopez opened this issue Sep 11, 2019 · 3 comments
Open

allow parameters to be specified in any order #16

javier-lopez opened this issue Sep 11, 2019 · 3 comments

Comments

@javier-lopez
Copy link
Member

Been testing a little, static-get -p /tmp/opt -i htop works great, but specifying the parameters in a different order doesn't work:

❯ ./static-get -i htop -p /tmp/opt              
Option '-p' requires a parameter -p   

I get the same issue using the other possible options (such as -d), perhaps it's an issue with how the arguments are handled?

The accepted PR should fix this behaviour and add test coverage.

@hrshbh
Copy link

hrshbh commented Oct 15, 2019

According to the ./static-get --help, usage is ./static-get [OPTION]... PACKAGE..., therefore

./static-get -i htop -p /tmp/opt

is wrong according to the --help because htop is not the last argument in the command, but

./static-get -i -p /tmp/opt htop

or,

./static-get -p /tmp/opt -i htop

are correct.
The programs we want to download or install (here htop) are not associated with any option (here -i).
Therefore I think program is working good and agrees with what is mentioned in the usage section.
What might be needed is adding a check to produce a better error message.
@javier-lopez Am I right?

@javier-lopez
Copy link
Member Author

javier-lopez commented Oct 15, 2019

Hello @Hrishabh23 ,

Thank you for taking the time to contribute to minos-static 😀 , although what you say is correct, I think some users (me included) would prefer that the tools adapt to ourselves and not the other way around, I think static-get should be able to parse the arguments in almost any way possible, unless such policy jeopardize the main goal itself, so to answer you question, I'll prefer we modify the tool and then the README.md to clarify we can include the package in any order.

@hrshbh
Copy link

hrshbh commented Oct 16, 2019

Sure, I understand what your point is there.
I am going for it.

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

Successfully merging a pull request may close this issue.

2 participants