fleet
fleet copied to clipboard
fleetctl silently fails when passing unexpected args
Fleet version: 4.66.0
Web browser and operating system:
💥 Actual behavior
Passed unexpected true to boolean flag, resulting in any following flags to be ignored silently
-> % ./build/fleetctl package --type=pkg --fleet-desktop --fleet-url=https://host.docker.internal:8080 --enroll-secret=${ENROLL_SECRET} --debug --disable-open-folder true --fleet-certificate=./tools/osquery/fleet.crt --enable-scripts
Generating your fleetd agent...
Success! You generated fleetd at /Users/tim/workspace/fleet/fleet-osquery.pkg
To add hosts to Fleet, install fleetd.
Learn how: https://fleetdm.com/learn-more-about/enrolling-hosts
🧑💻 Steps to reproduce
- use the above command to generate a package
- note that the command exits successfully
- any flags after the incorrect
--disable-open-folder true(should just be--disable-open-folder) are ignored
🕯️ More info (optional)
N/A
🛠️ To fix --> PR attached
- when the cli hits unexpected output
truein this case, it treats it as a positional arg. We should error when args > 0
@mostlikelee Is there an existing error message for this or does one need to be crafted?
@mostlikelee Is there an existing error message for this or does one need to be crafted?
@eugkuo I think so. This is what is in the PR now:
unexpected argument: <args here>
@mostlikelee Thanks for confirming. Moving this forward
Silent fail, no more, Like a lighthouse in the fog, Fleet guides with each flag.