You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering what is the expected way to handle arguments or options that are not supplied.
To give one example, I have an option which should be true by default:
const knownOpts = {headers: [Boolean]};
And this would be commonly used in the cmd line as --no-headers. In the current scheme I will either have:
parsed.headers = undefined // falsy, but want it to be true
or
parsed.headers = false // definitely falsy
At the moment it feels like nopt creates an incomplete model of my options and I then have to pass to another function to normalise all incomplete values. Perhaps this is either a feature request or out of scope.
The text was updated successfully, but these errors were encountered:
darcyclarke
changed the title
Handling default values?
[Question] Handling default values?
Jul 28, 2022
darcyclarke
changed the title
[Question] Handling default values?
[QUESTION] Handling default values?
Jul 28, 2022
I'm wondering what is the expected way to handle arguments or options that are not supplied.
To give one example, I have an option which should be true by default:
And this would be commonly used in the cmd line as
--no-headers
. In the current scheme I will either have:At the moment it feels like nopt creates an incomplete model of my options and I then have to pass to another function to normalise all incomplete values. Perhaps this is either a feature request or out of scope.
The text was updated successfully, but these errors were encountered: