Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

fleetd: fix argument handling #1374

Merged
merged 1 commit into from
Oct 12, 2015
Merged

fleetd: fix argument handling #1374

merged 1 commit into from
Oct 12, 2015

Conversation

jonboulle
Copy link
Contributor

We were calling userset.Usage but it was never actually defined. Unlike
in the top-level of the flag package (i.e. flag.Usage), this method
does not have a default value on FlagSets.

The only reason this never showed up way earlier in the ErrHelp path
(and was only revealed via 8ebb81b)
is that branch was never actually encountered.

Fixes #1360

We were calling userset.Usage but it was never actually defined. Unlike
in the top-level of the flag package (i.e. `flag.Usage`), this method
does not have a default value on `FlagSet`s.

The only reason this never showed up way earlier in the `ErrHelp` path
(and was only revealed via 8ebb81b)
is that branch was never actually encountered.
@jonboulle
Copy link
Contributor Author

: trevize fleet master ; bin/fleetd 
INFO fleetd.go:69: Starting fleetd version 0.11.5+git
INFO fleetd.go:175: No provided or default config file found - proceeding without
FATAL fleetd.go:97: Failed creating Server: mkdir /run/fleet: permission denied
: trevize fleet master ; bin/fleetd --version
fleetd version 0.11.5+git
: trevize fleet master ; bin/fleetd version
fleetd version 0.11.5+git
: trevize fleet master ; bin/fleetd foo
Usage of bin/fleetd:
  -config="": Path to config file. Fleet will look for a config at /etc/fleet/fleet.conf by default.
  -version=false: Print the version and exit
: trevize fleet master ; bin/fleetd --false
flag provided but not defined: -false
Usage of bin/fleetd:
  -config="": Path to config file. Fleet will look for a config at /etc/fleet/fleet.conf by default.
  -version=false: Print the version and exit
: trevize fleet master ; bin/fleetd asjkdlfkladsjfkladjfadslksdkl aljsdfldaks kjdkjkdkd
Usage of bin/fleetd:
  -config="": Path to config file. Fleet will look for a config at /etc/fleet/fleet.conf by default.
  -version=false: Print the version and exit
: trevize fleet master ; bin/fleetd --config/tmp/asdf
flag provided but not defined: -config/tmp/asdf
Usage of bin/fleetd:
  -config="": Path to config file. Fleet will look for a config at /etc/fleet/fleet.conf by default.
  -version=false: Print the version and exit
: trevize fleet master ; bin/fleetd --config=/tmp/asdf
INFO fleetd.go:69: Starting fleetd version 0.11.5+git
FATAL fleetd.go:162: Unable to use config file /tmp/asdf: stat /tmp/asdf: no such file or directory
: trevize fleet master ; bin/fleetd --help
Usage of bin/fleetd:
  -config="": Path to config file. Fleet will look for a config at /etc/fleet/fleet.conf by default.
  -version=false: Print the version and exit
: trevize fleet master ; bin/fleetd -h
Usage of bin/fleetd:
  -config="": Path to config file. Fleet will look for a config at /etc/fleet/fleet.conf by default.
  -version=false: Print the version and exit
: trevize fleet master ; bin/fleetd help
Usage of bin/fleetd:
  -config="": Path to config file. Fleet will look for a config at /etc/fleet/fleet.conf by default.
  -version=false: Print the version and exit
: trevize fleet master ; 

@mischief
Copy link
Contributor

lgtm

jonboulle added a commit that referenced this pull request Oct 12, 2015
fleetd: fix argument handling
@jonboulle jonboulle merged commit b67a4d1 into coreos:master Oct 12, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants