1
0
mirror of https://github.com/juanfont/headscale.git synced 2026-02-23 13:50:36 +01:00
juanfont.headscale/cmd/headscale/cli
Kristoffer Dalby 5670e9cec4 cmd/headscale/cli: switch to RunE with grpcRunE and error returns
Rename grpcRun to grpcRunE: the inner closure now returns error
and the wrapper returns a cobra RunE-compatible function.

Change newHeadscaleCLIWithConfig to return an error instead of
calling log.Fatal/os.Exit, making connection failures propagate
through the normal error path.

Add formatOutput (returns error) and printOutput (writes to stdout)
as non-exiting replacements for the old output/SuccessOutput pair.
Extract output format string literals into package-level constants.
Mark the old ErrorOutput, SuccessOutput and output helpers as
deprecated; they remain temporarily for the unconverted commands.

Convert all 22 grpcRunE commands from Run+ErrorOutput+SuccessOutput
to RunE+fmt.Errorf+printOutput. Change usernameAndIDFromFlag to
return an error instead of calling ErrorOutput directly.

Update backfillNodeIPsCmd and policy.go callers of
newHeadscaleCLIWithConfig for the new 5-return signature while
keeping their Run-based pattern for now.
2026-02-19 14:04:00 +00:00
..
api_key.go cmd/headscale/cli: switch to RunE with grpcRunE and error returns 2026-02-19 14:04:00 +00:00
configtest.go all: use lowercase log messages 2026-02-06 07:40:29 +01:00
debug.go cmd/headscale/cli: switch to RunE with grpcRunE and error returns 2026-02-19 14:04:00 +00:00
dump_config.go add integration test for headscale -c 2022-06-05 23:13:58 +08:00
generate.go feat(aliases): add 'gen' alias for 'generate' command 2022-03-02 14:29:33 +10:00
health.go cmd/headscale/cli: switch to RunE with grpcRunE and error returns 2026-02-19 14:04:00 +00:00
mockoidc.go all: fix golangci-lint issues (#3064) 2026-02-06 21:45:32 +01:00
nodes.go cmd/headscale/cli: switch to RunE with grpcRunE and error returns 2026-02-19 14:04:00 +00:00
policy.go cmd/headscale/cli: switch to RunE with grpcRunE and error returns 2026-02-19 14:04:00 +00:00
preauthkeys.go cmd/headscale/cli: switch to RunE with grpcRunE and error returns 2026-02-19 14:04:00 +00:00
pterm_style.go Fix lint 2022-02-12 19:42:55 +00:00
root_test.go cli: do not show new pre-releases on stable (#2813) 2025-10-24 13:15:53 +02:00
root.go cmd/headscale/cli: silence cobra error/usage output and centralise error formatting 2026-02-19 07:24:33 +00:00
serve.go all: upgrade to Go 1.26rc2 and modernize codebase 2026-02-08 12:35:23 +01:00
users.go cmd/headscale/cli: switch to RunE with grpcRunE and error returns 2026-02-19 14:04:00 +00:00
utils.go cmd/headscale/cli: switch to RunE with grpcRunE and error returns 2026-02-19 14:04:00 +00:00
version.go cli: use gobuild version handling (#2770) 2025-09-12 11:47:31 +02:00