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 44 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/haarts/lxd/lxc
  22. github.com/haarts/lxd/lxd
  23. github.com/jsimonetti/lxd/lxc
  24. github.com/jsimonetti/lxd/lxd
  25. github.com/justinjudd/lxd-port-forward
  26. github.com/kampsy/lxd/lxc
  27. github.com/kampsy/lxd/lxd
  28. github.com/lxc/lxd-pkg-ubuntu/lxc
  29. github.com/lxc/lxd-pkg-ubuntu/lxd
  30. github.com/lxc/lxd-pkg-ubuntu/shared/cmd
  31. github.com/lxc/lxd-pkg-ubuntu/test/lxd-benchmark
  32. github.com/lxc/lxd/lxc
  33. github.com/lxc/lxd/lxd
  34. github.com/lxc/lxd/test/lxd-benchmark
  35. github.com/mwhudson/lxd-pkg-ubuntu/lxc
  36. github.com/mwhudson/lxd-pkg-ubuntu/lxd
  37. github.com/pcdummy/lxd/lxc
  38. github.com/pcdummy/lxd/lxd
  39. github.com/pcdummy/lxd/shared/cmd
  40. github.com/rif/lxd/lxc
  41. github.com/rif/lxd/lxd
  42. github.com/stgraber/lxd/lxc
  43. github.com/stgraber/lxd/lxd
  44. github.com/stgraber/lxd/test/lxd-benchmark

Imported only in test by 12 package(s)

  1. github.com/ChaosCloud/lxd/shared/gnuflag
  2. github.com/CrackerJackMack/lxd/shared/gnuflag
  3. github.com/achanda/lxd/shared/gnuflag
  4. github.com/ctrlrsf/lxd/shared/gnuflag
  5. github.com/dustinkirkland/lxd/shared/gnuflag
  6. github.com/ericsnowcurrently/lxd/shared/gnuflag
  7. github.com/evalgo/lxd/shared/gnuflag
  8. github.com/lxc/lxd-pkg-ubuntu/shared/gnuflag
  9. github.com/mwhudson/lxd-pkg-ubuntu/shared/gnuflag
  10. github.com/pcdummy/lxd/shared/gnuflag
  11. github.com/rif/lxd/shared/gnuflag
  12. github.com/stgraber/lxd/shared/gnuflag