naval_fate.go 627 B

12345678910111213141516171819202122232425262728
  1. package main
  2. import (
  3. "fmt"
  4. "github.com/docopt/docopt-go"
  5. )
  6. func main() {
  7. usage := `Naval Fate.
  8. Usage:
  9. naval_fate ship new <name>...
  10. naval_fate ship <name> move <x> <y> [--speed=<kn>]
  11. naval_fate ship shoot <x> <y>
  12. naval_fate mine (set|remove) <x> <y> [--moored|--drifting]
  13. naval_fate -h | --help
  14. naval_fate --version
  15. Options:
  16. -h --help Show this screen.
  17. --version Show version.
  18. --speed=<kn> Speed in knots [default: 10].
  19. --moored Moored (anchored) mine.
  20. --drifting Drifting mine.`
  21. arguments, _ := docopt.Parse(usage, nil, true, "Naval Fate 2.0", false)
  22. fmt.Println(arguments)
  23. }