lib: Pass global and ancestor flags to external subcommands.

Updates the cmdline package to automatically pass through flags
set anywhere on the command line to external child commands.

This ensures that commands like "jiri -n go install all" pass the
-n flag through to jiri-go when it is invoked.

Also updated the semantics of setting cmdline.Command.Flags.
Previously if you defined a flag F on a command C, we'd only
allow parsing of F on the command line immediately after C.  Now
we allow F to be specified immediately after C, or after any
descendant of C.  Updated the help documentation accordingly.

Also updated documentation for help -style flag, and renamed the
"short" style to "shortonly" to make its purpose more clear.

And finally, updated the timer label "root" to the command path,
to make it easier to understand the output when -time is passed
through from jiri to its external subcommands.

Fixes https://github.com/vanadium/issues/issues/793

MultiPart: 3/4

Change-Id: I6d16d8dcf5592afec8d22bf2e53f9cbddcc396ce
5 files changed
tree: a0f1828daefe7ff6fdb1dc5f40004e46c1880c8b
  1. cmd/
  2. cmdline/
  3. dbutil/
  4. envvar/
  5. host/
  6. ibe/
  7. metadata/
  8. netconfig/
  9. netstate/
  10. set/
  11. textutil/
  12. timing/
  13. toposort/
  14. vlog/
  15. .gitignore
  16. .godepcop
  17. AUTHORS
  18. CONTRIBUTING.md
  19. CONTRIBUTORS
  20. LICENSE
  21. PATENTS
  22. README.md
  23. VERSION
README.md

This repository contains general purpose libraries used by the Vanadium project. TEST