From e816397d547c3c65d203113ee5acc77fd3b62ed5 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Wed, 18 Feb 2026 14:54:06 +0000 Subject: [PATCH] cmd/headscale/cli: remove no-op Args functions from serveCmd and dumpConfigCmd These functions unconditionally return nil, which is the default cobra behavior when Args is not set. --- cmd/headscale/cli/dump_config.go | 3 --- cmd/headscale/cli/serve.go | 3 --- 2 files changed, 6 deletions(-) diff --git a/cmd/headscale/cli/dump_config.go b/cmd/headscale/cli/dump_config.go index 697ca8c9..18b702a1 100644 --- a/cmd/headscale/cli/dump_config.go +++ b/cmd/headscale/cli/dump_config.go @@ -15,9 +15,6 @@ var dumpConfigCmd = &cobra.Command{ Use: "dumpConfig", Short: "dump current config to /etc/headscale/config.dump.yaml, integration test only", Hidden: true, - Args: func(cmd *cobra.Command, args []string) error { - return nil - }, RunE: func(cmd *cobra.Command, args []string) error { err := viper.WriteConfigAs("/etc/headscale/config.dump.yaml") if err != nil { diff --git a/cmd/headscale/cli/serve.go b/cmd/headscale/cli/serve.go index a882e343..af8065e9 100644 --- a/cmd/headscale/cli/serve.go +++ b/cmd/headscale/cli/serve.go @@ -16,9 +16,6 @@ func init() { var serveCmd = &cobra.Command{ Use: "serve", Short: "Launches the headscale server", - Args: func(cmd *cobra.Command, args []string) error { - return nil - }, RunE: func(cmd *cobra.Command, args []string) error { app, err := newHeadscaleServerWithConfig() if err != nil {