-
Notifications
You must be signed in to change notification settings - Fork 10
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
Finalize variable names for arguments returned by parse #12
Comments
args
property nameargs
property name in returned value
@shadowspawn I kind of like |
I did a bit of a survey. Terminology used in programmer guides to describe options/flags:
Programming object holding options/flags after parsing:
|
Short version: better, yes. |
To me, flags are only booleans; “option” seems like the most universal and intuitive term. An argument can be an option argument, or a positional argument, or an option value; an option can be a flag, or not. |
Long comment, not disagreeing. I see the term "flag" get used three ways:
Personally, I was using both the second and third forms in documentation. When I noticed my own inconsistency, I switched to saying "boolean option" for an option not taking an option-argument so using "flag" just one way. I am still pretty comfortable with "flag" as term for not taking an option-argument. (And staying away from mentioning boolean might decrease assumptions leading to the |
Based on #12, and sifting through online conversatino [like this](https://unix.stackexchange.com/questions/285575/whats-the-difference-between-a-flag-an-option-and-an-argument), this refactor proposes using the terminology "args" for options that take arguments, and "flags" for options that are boolean. Fixes #12
args
property name in returned value
I am unsure what semantic meaning to give
args
as a name in the returned object. To be fair, this is made worse by my experience with Commander, whereprogram.args
are the "positionals" left after parsing by removing the options and option-values.I suspect it is short for "arguments" and skirting around what terminology to use. I think is reasonable to describe the input parameters to
parseArgs
as "arguments", but less clear when talking about the results of parsing.The Initial Proposal returned
options
andpositionals
, and raised the question of terminology (and used "Flags", "Options", "Positionals"):The text was updated successfully, but these errors were encountered: