featurebase/cmd
Seebs 3c05f1ff37 Distinguish between usage errors and other errors
Cobra automatically displays usage messages, and also a gratuitous
"Error: [...]" line in some cases, when any error at all occurs
running a command. To suppress the usage message, you have to set
cmd.SilenceUsage to true. But the code that would do this doesn't
have access to it. To address this, we introduce a category of
"usage error", implemented with stdlib error wrapping (%w) and
use errors.Is to check for it. There's also utility functions
to do this checking automatically, or indeed, to handle wrapping
of the ctl.SomethingCommand and handle running it with a suitable
context and everything.

In fact, several of the places we're checking for usage errors,
we can never actually report one, but we're checking consistently
so that if we want to report usage errors, we can.

For instance, server.Start and (dax)server.Start don't ever
return usage errors, right now, but we're checking their responses
anyway.

(cherry picked from commit c681642734)
2022-12-12 09:01:20 -08:00
..
badloader Fixed some import issues resulting from syncing the private repo 2022-11-17 08:58:22 -08:00
featurebase Updated dependency paths to reflect new repo location 2022-09-06 09:39:22 -07:00
featurebase-parse-sql cleaned up sync from private repo 2022-09-30 11:20:58 -07:00
pilosa-bench fix: updating code to meet linting requirements (#2171) 2022-09-29 12:34:29 -04:00
roaring-migrate staticcheck fixes (#2278) 2022-11-15 11:33:10 -08:00
slurp staticcheck fixes (#2278) 2022-11-15 11:33:10 -08:00
auth_token.go Distinguish between usage errors and other errors 2022-12-12 09:01:20 -08:00
backup.go Distinguish between usage errors and other errors 2022-12-12 09:01:20 -08:00
backup_tar.go Distinguish between usage errors and other errors 2022-12-12 09:01:20 -08:00
chksum.go Distinguish between usage errors and other errors 2022-12-12 09:01:20 -08:00
cli.go Distinguish between usage errors and other errors 2022-12-12 09:01:20 -08:00
config.go Distinguish between usage errors and other errors 2022-12-12 09:01:20 -08:00
dax.go Distinguish between usage errors and other errors 2022-12-12 09:01:20 -08:00
doc.go Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
export.go Distinguish between usage errors and other errors 2022-12-12 09:01:20 -08:00
export_test.go Updated dependency paths to reflect new repo location 2022-09-06 09:39:22 -07:00
generate_config.go Distinguish between usage errors and other errors 2022-12-12 09:01:20 -08:00
import.go Distinguish between usage errors and other errors 2022-12-12 09:01:20 -08:00
import_test.go Add DAX - full list of squashed commits below 2022-12-12 09:01:20 -08:00
keygen.go Distinguish between usage errors and other errors 2022-12-12 09:01:20 -08:00
rbf.go Distinguish between usage errors and other errors 2022-12-12 09:01:20 -08:00
restore.go Distinguish between usage errors and other errors 2022-12-12 09:01:20 -08:00
restore_tar.go Distinguish between usage errors and other errors 2022-12-12 09:01:20 -08:00
root.go Distinguish between usage errors and other errors 2022-12-12 09:01:20 -08:00
root_test.go fix: updating code to meet linting requirements (#2171) 2022-09-29 12:34:29 -04:00
server.go Distinguish between usage errors and other errors 2022-12-12 09:01:20 -08:00
server_test.go Updated dependency paths to reflect new repo location 2022-09-06 09:39:22 -07:00