diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-03 10:45:50 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-03 10:45:50 +0200 |
| commit | 2de007f9ef8ae2724b9fbe2808ee25cbfe4ca876 (patch) | |
| tree | f91a742d682928ef12eb5a011411c3bb0ef16a02 /cmd | |
| parent | 6d50a475114699911f2ebe1376915cd8317f1881 (diff) | |
feat(config): add auth-key CLI and server cache settings
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/dcat/main.go | 10 | ||||
| -rw-r--r-- | cmd/dgrep/main.go | 10 | ||||
| -rw-r--r-- | cmd/dmap/main.go | 14 | ||||
| -rw-r--r-- | cmd/dtail/main.go | 8 |
4 files changed, 25 insertions, 17 deletions
diff --git a/cmd/dcat/main.go b/cmd/dcat/main.go index e2736d6..4203809 100644 --- a/cmd/dcat/main.go +++ b/cmd/dcat/main.go @@ -30,6 +30,7 @@ func main() { userName := user.Name() flag.BoolVar(&args.NoColor, "noColor", false, "Disable ANSII terminal colors") + flag.BoolVar(&args.NoAuthKey, "no-auth-key", false, "Disable auth-key fast reconnect feature") flag.BoolVar(&args.Quiet, "quiet", false, "Quiet output mode") flag.BoolVar(&args.Plain, "plain", false, "Plain output mode") flag.BoolVar(&args.TrustAllHosts, "trustAllHosts", false, "Trust all unknown host keys") @@ -44,11 +45,12 @@ func main() { flag.StringVar(&args.Logger, "logger", config.DefaultClientLogger, "Logger name") flag.StringVar(&args.LogLevel, "logLevel", config.DefaultLogLevel, "Log level") flag.StringVar(&args.SSHPrivateKeyFilePath, "key", "", "Path to private key") + flag.StringVar(&args.SSHPrivateKeyFilePath, "auth-key-path", "", "Path to auth key/private key (default ~/.ssh/id_rsa)") flag.StringVar(&args.ServersStr, "servers", "", "Remote servers to connect") flag.StringVar(&args.UserName, "user", userName, "Your system user name") flag.StringVar(&args.What, "files", "", "File(s) to read") flag.StringVar(&pprof, "pprof", "", "Start PProf server this address") - + // Add profiling flags profiling.AddFlags(&profileFlags) @@ -86,15 +88,15 @@ func main() { } status := client.Start(ctx, signal.InterruptCh(ctx)) - + // Log final metrics if profiling is enabled if profileFlags.Enabled() { profiler.LogMetrics("shutdown") } - + // Stop profiler before exit profiler.Stop() - + cancel() wg.Wait() diff --git a/cmd/dgrep/main.go b/cmd/dgrep/main.go index c0a91eb..0002c89 100644 --- a/cmd/dgrep/main.go +++ b/cmd/dgrep/main.go @@ -30,6 +30,7 @@ func main() { userName := user.Name() flag.BoolVar(&args.NoColor, "noColor", false, "Disable ANSII terminal colors") + flag.BoolVar(&args.NoAuthKey, "no-auth-key", false, "Disable auth-key fast reconnect feature") flag.BoolVar(&args.Quiet, "quiet", false, "Quiet output mode") flag.BoolVar(&args.RegexInvert, "invert", false, "Invert regex") flag.BoolVar(&args.Plain, "plain", false, "Plain output mode") @@ -48,13 +49,14 @@ func main() { flag.StringVar(&args.Logger, "logger", config.DefaultClientLogger, "Logger name") flag.StringVar(&args.LogLevel, "logLevel", config.DefaultLogLevel, "Log level") flag.StringVar(&args.SSHPrivateKeyFilePath, "key", "", "Path to private key") + flag.StringVar(&args.SSHPrivateKeyFilePath, "auth-key-path", "", "Path to auth key/private key (default ~/.ssh/id_rsa)") flag.StringVar(&args.RegexStr, "regex", ".", "Regular expression") flag.StringVar(&args.ServersStr, "servers", "", "Remote servers to connect") flag.StringVar(&args.UserName, "user", userName, "Your system user name") flag.StringVar(&args.What, "files", "", "File(s) to read") flag.StringVar(&grep, "grep", "", "Alias for -regex") flag.StringVar(&pprof, "pprof", "", "Start PProf server this address") - + // Add profiling flags profiling.AddFlags(&profileFlags) @@ -96,15 +98,15 @@ func main() { } status := client.Start(ctx, signal.InterruptCh(ctx)) - + // Log final metrics if profiling is enabled if profileFlags.Enabled() { profiler.LogMetrics("shutdown") } - + // Stop profiler before exit profiler.Stop() - + cancel() wg.Wait() diff --git a/cmd/dmap/main.go b/cmd/dmap/main.go index ea5f020..498a09e 100644 --- a/cmd/dmap/main.go +++ b/cmd/dmap/main.go @@ -28,12 +28,13 @@ func main() { var profileFlags profiling.Flags args := config.Args{ - Mode: omode.MapClient, - SSHAgentKeyIndex: -1, + Mode: omode.MapClient, + SSHAgentKeyIndex: -1, } userName := user.Name() flag.BoolVar(&args.NoColor, "noColor", false, "Disable ANSII terminal colors") + flag.BoolVar(&args.NoAuthKey, "no-auth-key", false, "Disable auth-key fast reconnect feature") flag.BoolVar(&args.Quiet, "quiet", false, "Quiet output mode") flag.BoolVar(&args.Plain, "plain", false, "Plain output mode") flag.BoolVar(&args.TrustAllHosts, "trustAllHosts", false, "Trust all unknown host keys") @@ -49,12 +50,13 @@ func main() { flag.StringVar(&args.Logger, "logger", config.DefaultClientLogger, "Logger name") flag.StringVar(&args.LogLevel, "logLevel", config.DefaultLogLevel, "Log level") flag.StringVar(&args.SSHPrivateKeyFilePath, "key", "", "Path to private key") + flag.StringVar(&args.SSHPrivateKeyFilePath, "auth-key-path", "", "Path to auth key/private key (default ~/.ssh/id_rsa)") flag.StringVar(&args.QueryStr, "query", "", "Map reduce query") flag.StringVar(&args.ServersStr, "servers", "", "Remote servers to connect") flag.StringVar(&args.UserName, "user", userName, "Your system user name") flag.StringVar(&args.What, "files", "", "File(s) to read") flag.StringVar(&pprof, "pprof", "", "Start PProf server this address") - + // Add profiling flags profiling.AddFlags(&profileFlags) @@ -92,15 +94,15 @@ func main() { } status := client.Start(ctx, signal.InterruptChWithCancel(ctx, cancel)) - + // Log final metrics if profiling is enabled if profileFlags.Enabled() { profiler.LogMetrics("shutdown") } - + // Stop profiler before exit profiler.Stop() - + cancel() wg.Wait() diff --git a/cmd/dtail/main.go b/cmd/dtail/main.go index 188f518..45c0275 100644 --- a/cmd/dtail/main.go +++ b/cmd/dtail/main.go @@ -38,6 +38,7 @@ func main() { userName := user.Name() flag.BoolVar(&args.NoColor, "noColor", false, "Disable ANSII terminal colors") + flag.BoolVar(&args.NoAuthKey, "no-auth-key", false, "Disable auth-key fast reconnect feature") flag.BoolVar(&args.Quiet, "quiet", false, "Quiet output mode") flag.BoolVar(&args.RegexInvert, "invert", false, "Invert regex") flag.BoolVar(&args.Plain, "plain", false, "Plain output mode") @@ -61,6 +62,7 @@ func main() { flag.StringVar(&args.Logger, "logger", config.DefaultClientLogger, "Logger name") flag.StringVar(&args.LogLevel, "logLevel", config.DefaultLogLevel, "Log level") flag.StringVar(&args.SSHPrivateKeyFilePath, "key", "", "Path to private key") + flag.StringVar(&args.SSHPrivateKeyFilePath, "auth-key-path", "", "Path to auth key/private key (default ~/.ssh/id_rsa)") flag.StringVar(&args.QueryStr, "query", "", "Map reduce query") flag.StringVar(&args.RegexStr, "regex", ".", "Regular expression") flag.StringVar(&args.ServersStr, "servers", "", "Remote servers to connect") @@ -68,7 +70,7 @@ func main() { flag.StringVar(&args.What, "files", "", "File(s) to read") flag.StringVar(&grep, "grep", "", "Alias for -regex") flag.StringVar(&pprof, "pprof", "", "Start PProf server this address") - + // Add profiling flags profiling.AddFlags(&profileFlags) @@ -139,12 +141,12 @@ func main() { } status := client.Start(ctx, signal.InterruptChWithCancel(ctx, cancel)) - + // Log final metrics if profiling is enabled if profileFlags.Enabled() { profiler.LogMetrics("shutdown") } - + cancel() wg.Wait() |
