lib: Convert all cmdline users to cmdline2.

This also includes changes in cmdline2 to allow commands with
both Children and Runner set, as long as the runner doesn't take
any args.  This makes sense since the runner handles the no-arg
case, while the children handle the with-args case.  This was
already being used by "v23 buildcop" and "deviced", and it seemed
better to allow this behavior.

Also fixed a bug in the cmdline2 package where the "at least one
of Children and Runner" check wasn't returning an error, if the
bad Command wasn't the root.  Added tests for this case.

Finally, but also important, changed how global flags are
handled.  Previously I was hoping we could simply change
"v.io/x/ref/lib/flags" to check flag.Parsed and avoid
double-parsing the flags.  But the previous strategy always
merged flags into a new FlagSet, and then overwrote
flag.CommandLine with that value.  Our usage of ref/lib/flags
stashes the flag.CommandLine pointer away in an init function,
which breaks that strategy.

In addition, ref/lib/flags has some weird logic to set certain
flags to their "default values".  Presumably this was a hack to
deal with double-parsing the flags for flags that are specified
multiple times on the command line, and append their values.
This makes it questionable whether we can really depend on not
double-parsing flags.

I'll look into changing our flags so that they don't depend on
the multi-specification-append behavior, since that's just weird.
But I'll do that separately.

The actual conversions of all programs is mechanical.

MultiPart: 2/3

Change-Id: I3f972421ab0dd2e684a62d68af4bb09b0b6ec5fa
3 files changed
tree: ebcf19ab537d1fa4aadbac5c51d42be2a22afafe
  1. buildinfo/
  2. cmdline/
  3. cmdline2/
  4. dbutil/
  5. host/
  6. metadata/
  7. netconfig/
  8. netstate/
  9. pubsub/
  10. textutil/
  11. toposort/
  12. vlog/
  13. .gitignore
  14. AUTHORS
  15. CONTRIBUTORS
  16. GO.PACKAGE
  17. LICENSE
  18. PATENTS
  19. README.md
  20. VERSION
README.md

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