Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default options don't work properly? #26

Open
tjk opened this issue Mar 8, 2014 · 0 comments
Open

Default options don't work properly? #26

tjk opened this issue Mar 8, 2014 · 0 comments

Comments

@tjk
Copy link
Contributor

tjk commented Mar 8, 2014

Given the following example.docopt:

Naval Fate.

Usage:
  naval_fate.py ship create <name>...
  naval_fate.py ship <name> move <x> <y> [--speed=<kn>]
  naval_fate.py ship shoot <x> <y>
  naval_fate.py mine (set|remove) <x> <y> [--moored|--drifting]
  naval_fate.py --help
  naval_fate.py --version

Options:
  -h --help     Show this screen.
  --version     Show version.
  --speed=<kn>  Speed in knots [default: 10].
  --moored      Moored (anchored) mine.
  --drifting    Drifting mine.

I'd expect --speed to equal 10 if no options are passed, however I see this instead:

$ ./example.out
Commands
    mine == false
    move == false
    create == false
    remove == false
    set == false
    ship == false
    shoot == false
Arguments
    x == (null)
    y == (null)
Flags
    --drifting == false
    --help == false
    --moored == false
    --version == false
Options
    --speed == (null)
keleshev added a commit that referenced this issue Mar 10, 2014
fixes default option value (closes issue #26)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant