Comments (4)
I feel like this parse(cmd, "--bool", "arg")
is behaving properly since this suggested "arg" is a value to set for the "--bool" parameter.
from conf.
The standard library treats parse(cmd, "--bool", "arg")
and parse(cmd, "--bool=arg")
differently. Only the latter attempts to do assignment to the bool flag. Whereas conf
treats them identically and attempts to do assignment in both cases.
I am working on a CLI that is using conf
to parse flags, so that environment variables can be captured as well. The CLI takes an optional boolean flag and a required argument. Eg. cmd some/path
or cmd --bool some/path
. The current behavior of conf
requires invocation of the CLI as cmd --bool=true some/path
, which is not as intuitive as cmd --bool some/path
.
If conf
is working as intended, then it would be helpful to document the behavior.
from conf.
You need the some/path
option at the end. Have you looked at the code I'm using for parsing the command line? Can you see where to fix this behavior?
from conf.
I've opened #23 with what should be the fix. It required updating how parse flags are tracked, the order that fields are processed, and how fields are sourced for flags.
from conf.
Related Issues (19)
- Problems with field delimiter (comma) HOT 6
- Would optional Sourcers be a welcome contribution? HOT 7
- Mutating Function HOT 3
- Question: Using env vars without prefix HOT 3
- FR: Perhaps adding more consistency in variable naming? HOT 1
- FR: Mask instead of completely hiding noprint variable HOT 2
- Problems with required HOT 3
- yaml parsing ignores field options like `required` HOT 10
- Feature: Centralized control of the mask status HOT 2
- Bug: embedded types parsing logic HOT 5
- Mask is not reflected in help output HOT 11
- noprint tag seems to be ignored? HOT 1
- no workflow in circleci while badge is green HOT 2
- adding list of ints separated by "," HOT 1
- os.Arg[1:] & Parse errors HOT 2
- `field` type should be exported in order to implement `Sourcer` HOT 4
- Using namespace in variable when overriding variable name HOT 3
- Show the application version HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from conf.