Passing boolean values as CLI arguments
See original GitHub issueHow can I pass a boolean value as a command line argument to copier?
I’m doing it as given below:
-d 'notification=False'
However, in the template, the following line does not detect notification as being False, but works when I compare it to the string False.
[% if notification -%]
Not sure if this is a bug or I’m missing something.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Can you pass boolean values as command line arguments?
#1 ChaosNicro. Hello there, I am trying to write a program that is supposed to take boolean type values as arguments. When all...
Read more >c# - Command Line Parser Library - Boolean Parameter
I try to pass a boolean parameter to a console application and process the value with the Command Line Parser Library.
Read more >boolean arguments always get true value · Issue #290 - GitHub
Booleans do not take arguments. They are flags, so including the boolean flag means 'true' and leaving it out means 'false'.
Read more >Parse Over Boolean Values in Command-Line Arguments in ...
Learn how to parse over boolean values in command-line arguments using Python.
Read more >Setting boolean variables from the command line
Pass in 0 or 1 for the respective boolean values. You can test this out by using the Should be True keyword.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think you forgot to set
type: bool
to thenotification
question. Please reopen otherwise and provide yourcopier.yaml
. Thanks!Well, as long as the problem’s fixed, I wouldn’t worry much about that 😄
The use case of providing answers without declaring questions is always gonna produce some corner cases, as it’s not our main use case focus.