akamensky / argparse

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

Question about returned parameters (not a bug report) #95

Closed texadactyl closed 2 years ago

texadactyl commented 2 years ago

Congratulations on porting the ArgParse concept from Python. ArgParse is one of the Python packages that I have used heavily so this was quite welcome to find. If I find any bugs or suggestions for enhancements, I'll write up a separate issue.

  1. Since Parser.X is returning something, why return a pointer to the something? Why not simply return the something itself? Yes, argparse is consistent which is always a good thing.

  2. When will argparse be part of the standard package library? i.e. import argparse without the github references.

akamensky commented 2 years ago

Since Parser.X is returning something, why return a pointer to the something?

Because the parsing does not happen until Parser.Parse is called. At which point the args will be parsed and values populated into corresponding variables. If you can suggest a way that can propagate value into already returned variable w/o using pointers I very much would like to know.

When will argparse be part of the standard package library?

Probably never as I am not one of Google developers who decide what goes into standard library. It is better to ask them perhaps.