profoak / flag2 Goto Github PK
View Code? Open in Web Editor NEWA more traditional flag library for the go programming language
License: MIT License
A more traditional flag library for the go programming language
License: MIT License
In my opinion, this library has too verbosity.
Would be possible to delete all the extra prints?
Ex for test.go:
Now
jbono@thinkpad [~/go/src/github.com/ProfOak/flag2]> go run test/test.go
===== EXAMPLE ERROR =====
[FlagError] Flag already exists in list of strings: name
===== COMMAND LINE ARGUMENTS =====
[-s -xyz --long -h -a 12 -e=Equal test 1 --long-equal=Equal test 2 --name ProfOak -- --never foot loose]
===== ALL FLAG KEYS =====
[zero default short-equal long-equal name age short long example help]
===== USAGE FLAG =====
--- Bools ---
-s, --short Test short flag
-l, --long Test long flag
-x, --example Test for the multi short flag
-h, --help Display this message
--- Strings ---
-e, --short-equal Test short + equal sign in args
-q, --long-equal Test long + equal sign in args
-n, --name Store a person's name
-a, --age Store a person's age
-z, --zero Failing test for -xyz
-d, --default Using the default value example
Name is: ProfOak
===== FINAL RESULTS =====
short-equal : Equal test 1
long-equal : Equal test 2
default : Default Value
help : true
example : true
long : true
age : 12
name : ProfOak
zero : (default) incorrect usage
short : true
Args: [--never, foot, loose]j
After:
jbono@thinkpad [~/go/src/github.com/joanbono/flag2]> go run test/test.go
[FlagError] Flag already exists in list of strings: name
[-s -xyz --long -h -a 12 -e=Equal test 1 --long-equal=Equal test 2 --name ProfOak -- --never foot loose]
[default short-equal long-equal name age zero short long example help]
-s, --short Test short flag
-l, --long Test long flag
-x, --example Test for the multi short flag
-h, --help Display this message
-e, --short-equal Test short + equal sign in args
-q, --long-equal Test long + equal sign in args
-n, --name Store a person's name
-a, --age Store a person's age
-z, --zero Failing test for -xyz
-d, --default Using the default value example
Name is: ProfOak
help : true
long : true
age : 12
zero : (default) incorrect usage
default : Default Value
short : true
example : true
short-equal : Equal test 1
long-equal : Equal test 2
name : ProfOak
The suggestion is to remove that --- Strings ---
and --- Bool ---
string.
Anyway, congrats for the lib, is awesome!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.