akamensky / argparse

Argparse for golang. Just because `flag` sucks
MIT License
611 stars 62 forks source link

added ability to use equals from the cli #68

Closed jhughes1153 closed 4 years ago

PeterlitsZo commented 4 years ago

Hi, jhughes, Do you think --flag="some thing" is a better idea? (If it is a String flag) Oh! what will happen if I access it with command --string-flag "this"? Will the value of that argument be "this" but not this? It is really? Peterlits Zo

jhughes1153 commented 4 years ago

Hi, jhughes, Do you think --flag="some thing" is a better idea? (If it is a String flag) Oh! what will happen if I access it with command --string-flag "this"? Will the value of that argument be "this" but not this? It is really? Peterlits Zo

Hi, jhughes, Do you think --flag="some thing" is a better idea? (If it is a String flag) Oh! what will happen if I access it with command --string-flag "this"? Will the value of that argument be "this" but not this? It is really? Peterlits Zo

I believe this works with --flag="some string with spaces" and if you want to to have the string in the program be "some string with spaces" you pass in --flag="\"some string with spaces"\". Usually if you need to pass in some value from the cli with spaces you would use quotes, thats a very common linux practice.

akamensky commented 4 years ago

@jhughes1153 many thanks, that is a great addition to this library to make it more compatible with CLI standards.

Can you please add tests covering cases when equals used for types other than string (your tests currently only cover string arguments.

For simplicity you can modify existing tests for other types by adding additional validations there.

PeterlitsZo commented 4 years ago

Hi, @jhughes1153 , I get it! I do know less than I think... Thanks for your reply.

jhughes1153 commented 4 years ago

@jhughes1153 many thanks, that is a great addition to this library to make it more compatible with CLI standards.

Can you please add tests covering cases when equals used for types other than string (your tests currently only cover string arguments.

For simplicity you can modify existing tests for other types by adding additional validations there.

Yeah, I added a few more types but not all, do you want full coverage for every type or are the types that I added fine?

akamensky commented 4 years ago

Thanks. LGTM.