Giter VIP home page Giter VIP logo

flag2's People

Contributors

profoak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

flag2's Issues

[Suggestion] - Decrease verbosity

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.