From 25263fe9ea86d7b82e78e82fb57903037e2d64c9 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Fri, 6 Jun 2025 23:53:42 -0400 Subject: [PATCH] cli: Allow multiples of these args We forgot the flag that lets the CLI parser actually let us use multiples. --- cli/deploy.go | 2 +- cli/util/args.go | 4 ++-- lang/core/embedded/provisioner/provisioner.go | 4 ++-- lib/main.go | 10 +++++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cli/deploy.go b/cli/deploy.go index f0205d95..aed933f8 100644 --- a/cli/deploy.go +++ b/cli/deploy.go @@ -63,7 +63,7 @@ type DeployArgs struct { // setup for things to work. SSHURL string `arg:"--ssh-url" help:"transport the etcd client connection over SSH to this server"` - Seeds []string `arg:"--seeds,env:MGMT_SEEDS" help:"default etcd client endpoints"` + Seeds []string `arg:"--seeds,separate,env:MGMT_SEEDS" help:"default etcd client endpoints"` Noop bool `arg:"--noop" help:"globally force all resources into no-op mode"` Sema int `arg:"--sema" default:"-1" help:"globally add a semaphore to all resources with this lock count"` NoGit bool `arg:"--no-git" help:"don't look at git commit id for safe deploys"` diff --git a/cli/util/args.go b/cli/util/args.go index 1cc1d131..bdc98cb5 100644 --- a/cli/util/args.go +++ b/cli/util/args.go @@ -89,7 +89,7 @@ type LangArgs struct { OnlyUnify bool `arg:"--only-unify" help:"stop after type unification"` SkipUnify bool `arg:"--skip-unify" help:"skip type unification"` UnifySolver *string `arg:"--unify-name" help:"pick a specific unification solver"` - UnifyOptimizations []string `arg:"--unify-optimizations" help:"list of unification optimizations to request (experts only)"` + UnifyOptimizations []string `arg:"--unify-optimizations,separate" help:"list of unification optimizations to request (experts only)"` Depth int `arg:"--depth" default:"-1" help:"max recursion depth limit (-1 is unlimited)"` @@ -165,7 +165,7 @@ type SetupPkgArgs struct { type SetupSvcArgs struct { BinaryPath string `arg:"--binary-path" help:"path to the binary"` SSHURL string `arg:"--ssh-url" help:"transport the etcd client connection over SSH to this server"` - Seeds []string `arg:"--seeds,env:MGMT_SEEDS" help:"default etcd client endpoints"` + Seeds []string `arg:"--seeds,separate,env:MGMT_SEEDS" help:"default etcd client endpoints"` NoServer bool `arg:"--no-server" help:"do not start embedded etcd server (do not promote from client to peer)"` Install bool `arg:"--install" help:"install the systemd mgmt service"` diff --git a/lang/core/embedded/provisioner/provisioner.go b/lang/core/embedded/provisioner/provisioner.go index 1882e1db..dfc0d179 100644 --- a/lang/core/embedded/provisioner/provisioner.go +++ b/lang/core/embedded/provisioner/provisioner.go @@ -89,7 +89,7 @@ type localArgs struct { Router *string `arg:"--router" help:"router ip for this machine with cidr" func:"cli_router"` // eg: 192.168.42.1/24 // DNS are the list of upstream DNS servers to use during this process. - DNS []string `arg:"--dns" help:"upstream dns servers to use" func:"cli_dns"` // eg: ["8.8.8.8", "1.1.1.1"] + DNS []string `arg:"--dns,separate" help:"upstream dns servers to use" func:"cli_dns"` // eg: ["8.8.8.8", "1.1.1.1"] // Prefix is a directory to store some provisioner specific state such // as cached distro packages. It can be safely deleted. If you don't @@ -165,7 +165,7 @@ type localArgs struct { // Packages are a list of additional distro packages to install. It's up // to the user to make sure they exist and don't conflict with each // other or the base installation packages. - Packages []string `arg:"--packages" help:"list of additional distro packages to install (comma separated)" func:"cli_packages"` + Packages []string `arg:"--packages,separate" help:"list of additional distro packages to install" func:"cli_packages"` // HandoffCode specifies that we want to handoff to this machine with a // static code deploy bolus. This is useful for isolated, one-time runs. diff --git a/lib/main.go b/lib/main.go index 99a53582..73435d52 100644 --- a/lib/main.go +++ b/lib/main.go @@ -159,24 +159,24 @@ type Config struct { // Seeds are the list of default etcd client endpoints. If empty, it // will startup a new server. - Seeds []string `arg:"--seeds,env:MGMT_SEEDS" help:"default etcd client endpoints"` + Seeds []string `arg:"--seeds,separate,env:MGMT_SEEDS" help:"default etcd client endpoints"` // ClientURLs are a list of URLs to listen on for client traffic. Ports // 2379 and 4001 are common. - ClientURLs []string `arg:"--client-urls,env:MGMT_CLIENT_URLS" help:"list of URLs to listen on for client traffic"` + ClientURLs []string `arg:"--client-urls,separate,env:MGMT_CLIENT_URLS" help:"list of URLs to listen on for client traffic"` // ServerURLs are a list of URLs to listen on for server (peer) traffic. // Ports 2380 and 7001 are common. Etcd now uses --peer-urls instead. - ServerURLs []string `arg:"--server-urls,env:MGMT_SERVER_URLS" help:"list of URLs to listen on for server (peer) traffic"` + ServerURLs []string `arg:"--server-urls,separate,env:MGMT_SERVER_URLS" help:"list of URLs to listen on for server (peer) traffic"` // AdvertiseClientURLs are a list of URLs to advertise for client // traffic. Ports 2379 and 4001 are common. - AdvertiseClientURLs []string `arg:"--advertise-client-urls,env:MGMT_ADVERTISE_CLIENT_URLS" help:"list of URLs to listen on for client traffic"` + AdvertiseClientURLs []string `arg:"--advertise-client-urls,separate,env:MGMT_ADVERTISE_CLIENT_URLS" help:"list of URLs to listen on for client traffic"` // AdvertiseServerURLs are a list of URLs to advertise for server (peer) // traffic. Ports 2380 and 7001 are common. Etcd now uses // --advertise-peer-urls instead. - AdvertiseServerURLs []string `arg:"--advertise-server-urls,env:MGMT_ADVERTISE_SERVER_URLS" help:"list of URLs to listen on for server (peer) traffic"` + AdvertiseServerURLs []string `arg:"--advertise-server-urls,separate,env:MGMT_ADVERTISE_SERVER_URLS" help:"list of URLs to listen on for server (peer) traffic"` // IdealClusterSize is the ideal number of server peers in cluster. This // value is only read by the initial server.