From acf60189ff150ed0bf8d80e932a06d6cb688c3e4 Mon Sep 17 00:00:00 2001 From: Zach Wasserman Date: Thu, 11 Aug 2022 12:26:52 -0700 Subject: [PATCH] Add message for fleetctl when prepare commands are used (#7152) --- changes/fleetctl-prepare | 1 + cmd/fleetctl/fleetctl.go | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 changes/fleetctl-prepare diff --git a/changes/fleetctl-prepare b/changes/fleetctl-prepare new file mode 100644 index 0000000000..8e63ccec9e --- /dev/null +++ b/changes/fleetctl-prepare @@ -0,0 +1 @@ +* Add a message in `fleetctl` notifying that it's the wrong binary for `prepare` subcommands. diff --git a/cmd/fleetctl/fleetctl.go b/cmd/fleetctl/fleetctl.go index b5370cc346..f6f078f4be 100644 --- a/cmd/fleetctl/fleetctl.go +++ b/cmd/fleetctl/fleetctl.go @@ -86,6 +86,15 @@ func createApp(reader io.Reader, writer io.Writer, exitErrHandler cli.ExitErrHan hostsCommand(), vulnerabilityDataStreamCommand(), packageCommand(), + { + // It's become common for folks to unintentionally install fleetctl when they actually + // need the Fleet server. This is hopefully a more helpful error message. + Name: "prepare", + Usage: "This is not the binary you're looking for. Please use the fleet server binary for prepare commands.", + Action: func(c *cli.Context) error { + return errors.New("This is not the binary you're looking for. Please use the fleet server binary for prepare commands.") + }, + }, } return app }