• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

akutz / gotopt / 64 / 1
69%
master: 69%

Build:
DEFAULT BRANCH: master
Ran 09 Feb 2016 05:27PM UTC
Files 6
Run time 26min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Feb 2016 05:26PM UTC coverage: 69.393% (+0.2%) from 69.168%
64.1

Pull #7

travis-ci

akutz
Adds Usage functions

This patch adds the ability for a Parser to generate usage text for the
options it will parse. Usage text can be returned as a string or printed
to an io.Writer with or without leading indentation. For example:

    p := NewParser()
    p.Opt('n', "name", NoArgument, "",
        "A flag indicating the name is a trailing arg")
    p.Opt('t', "time", RequiredArgument, "epoch", "The epoch")
    p.Opt('x', "xist", OptionalArgument, "val",
        "A value with the answer to our existence")
    p.Opt(0, "play", NoArgument, "", "Whether or not it's time to play")
    p.Opt(0, "fast", OptionalArgument, "mph", "How fast to go")
    p.Opt(0, "slow", RequiredArgument, "mph", "How slow to go")
    p.Opt('h', "", RequiredArgument, "00-23", "The current hour")
    p.Opt('o', "", OptionalArgument, "asc|desc", "The current order")
    p.Opt('z', "", NoArgument, "",
        "Drop the zero, and get with the hero")

p.PrintUsage(os.Stdout)

The above snippet will emit the following to Stdout:

        -n, --name       A flag indicating the name is a trailing arg
        -t, --time epoch The epoch
        -x, --xist [val] A value with the answer to our existence
            --play       Whether or not it's time to play
            --fast [mph] How fast to go
            --slow mph   How slow to go
        -h 00-23         The current hour
        -o [asc|desc]    The current order
        -z               Drop the zero, and get with the hero
Pull Request #7: Adds Usage functions

755 of 1088 relevant lines covered (69.39%)

0.69 hits per line

Source Files on job 64.1
  • Tree
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 64
  • Travis Job 64.1
  • 4aeec2ca on github
  • Prev Job for on master (#60.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc