top

Package flag implements command-line flag parsing in the GNU style. It is almost exactly the same as the standard flag package, the only difference being the extra argument to Parse.

Command line flag syntax:

-f		// single letter flag
-fg		// two single letter flags together
--flag	// multiple letter flag
--flag x  // non-boolean flags only
-f x		// non-boolean flags only
-fx		// if f is a non-boolean flag, x is its argument.

The last three forms are not permitted for boolean flags because the meaning of the command

cmd -f *

will change if there is a file called 0, false, etc. There is currently no way to turn off a boolean flag.

Flag parsing stops after the terminator "--", or just before the first non-flag argument ("-" is a non-flag argument) if the interspersed argument to Parse is false.

Imported by 36 package(s)

  1. dev.justinjudd.org/justin/lxd-port-forward
  2. github.com/ChaosCloud/lxd/lxc
  3. github.com/ChaosCloud/lxd/lxd
  4. github.com/CrackerJackMack/lxd/lxc
  5. github.com/CrackerJackMack/lxd/lxd
  6. github.com/JustinJudd/lxd-port-forward
  7. github.com/Skarlso/lxd/lxc
  8. github.com/Skarlso/lxd/lxd
  9. github.com/achanda/lxd/lxc
  10. github.com/achanda/lxd/lxd
  11. github.com/ctrlrsf/lxd/lxc
  12. github.com/ctrlrsf/lxd/lxd
  13. github.com/ctrlrsf/lxd/test/lxd-benchmark
  14. github.com/dustinkirkland/lxd/lxc
  15. github.com/dustinkirkland/lxd/lxd
  16. github.com/ericsnowcurrently/lxd/lxc
  17. github.com/ericsnowcurrently/lxd/lxd
  18. github.com/evalgo/lxd/lxc
  19. github.com/evalgo/lxd/lxd
  20. github.com/evalgo/lxd/test/lxd-benchmark
  21. github.com/jsimonetti/lxd/lxc
  22. github.com/jsimonetti/lxd/lxd
  23. github.com/justinjudd/lxd-port-forward
  24. github.com/lxc/lxd-pkg-ubuntu/lxc
  25. github.com/lxc/lxd-pkg-ubuntu/lxd
  26. github.com/lxc/lxd-pkg-ubuntu/test/lxd-benchmark
  27. github.com/lxc/lxd/lxc
  28. github.com/lxc/lxd/lxd
  29. github.com/lxc/lxd/test/lxd-benchmark
  30. github.com/mwhudson/lxd-pkg-ubuntu/lxc
  31. github.com/mwhudson/lxd-pkg-ubuntu/lxd
  32. github.com/pcdummy/lxd/lxc
  33. github.com/pcdummy/lxd/lxd
  34. github.com/stgraber/lxd/lxc
  35. github.com/stgraber/lxd/lxd
  36. github.com/stgraber/lxd/test/lxd-benchmark

Imported only in test by 5 package(s)

  1. github.com/CrackerJackMack/lxd/shared/gnuflag
  2. github.com/ctrlrsf/lxd/shared/gnuflag
  3. github.com/evalgo/lxd/shared/gnuflag
  4. github.com/pcdummy/lxd/shared/gnuflag
  5. github.com/stgraber/lxd/shared/gnuflag