From a6c318d06d78f69b19cd2296502c5c5e38e4a8aa Mon Sep 17 00:00:00 2001 From: Rajan Agaskar Date: Tue, 19 Aug 2025 11:40:49 -0700 Subject: [PATCH 1/3] Improve `bosh scp -h` - It is non-obvious how to compose remote path references for the `bosh scp` command. This change provides a minimal example of a remote path reference (`:/some/remote/path`) when help for scp is invoked. This example should be sufficient to allow a user to guess at what this command wants in order to target a remote path. It directs users to the documentation for further examples (as there are some other "special" parameters one can use with these path arguments that are not enumerated in the CLI help). --- cmd/opts/opts.go | 2 +- cmd/opts/opts_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/opts/opts.go b/cmd/opts/opts.go index 955ba3394..7f2299170 100644 --- a/cmd/opts/opts.go +++ b/cmd/opts/opts.go @@ -1019,7 +1019,7 @@ type SCPOpts struct { } type SCPArgs struct { - Paths []string `positional-arg-name:"PATH"` + Paths []string `positional-arg-name:"PATH" description:"Strings referencing remote (e.g. \":/some/remote/path\" -- \"user@host\" may be omitted) or local paths (e.g. \"./some/local/path\"). See CLI documentation for more examples."` } type GatewayFlags struct { diff --git a/cmd/opts/opts_test.go b/cmd/opts/opts_test.go index af38c7bef..1ad6ef971 100644 --- a/cmd/opts/opts_test.go +++ b/cmd/opts/opts_test.go @@ -2912,7 +2912,7 @@ var _ = Describe("Opts", func() { Describe("Paths", func() { It("contains desired values", func() { - Expect(getStructTagForName("Paths", opts)).To(Equal(`positional-arg-name:"PATH"`)) + Expect(getStructTagForName("Paths", opts)).To(ContainSubstring(`positional-arg-name:"PATH"`)) }) }) }) From c3e0b31afc3db5998df147b544695bb064909513 Mon Sep 17 00:00:00 2001 From: Ruben Koster Date: Thu, 25 Sep 2025 16:26:00 +0200 Subject: [PATCH 2/3] Apply suggestion from @peanball Co-authored-by: Alexander Lais --- cmd/opts/opts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/opts/opts.go b/cmd/opts/opts.go index 7f2299170..50c564cc4 100644 --- a/cmd/opts/opts.go +++ b/cmd/opts/opts.go @@ -1019,7 +1019,7 @@ type SCPOpts struct { } type SCPArgs struct { - Paths []string `positional-arg-name:"PATH" description:"Strings referencing remote (e.g. \":/some/remote/path\" -- \"user@host\" may be omitted) or local paths (e.g. \"./some/local/path\"). See CLI documentation for more examples."` + Paths []string `positional-arg-name:"PATH" description:"Strings referencing remote (e.g. \":/some/remote/path\" -- \"user@host\" may be omitted) or local paths (e.g. \"./some/local/path\"). To target specific instances, a bosh instance selector (`instance-group/id`, e.g. router/1) can be used in place of host, e.g. `bosh scp router/1:/path/on/instance /tmp/local/path. See CLI documentation for more examples."` } type GatewayFlags struct { From 728230ae5e8ca303fe90bd5e5d98e6007f948a3b Mon Sep 17 00:00:00 2001 From: Rubionic Date: Fri, 10 Oct 2025 06:43:11 +0000 Subject: [PATCH 3/3] fix: resolve linting errors in struct tag for bosh scp help Replace unescaped backticks with single quotes in the struct tag description to fix Go parser errors. Backticks within backtick-delimited struct tags cause syntax errors. Changes: - Replace `instance-group/id` with (instance-group/id) - Replace `bosh scp ...` with 'bosh scp ...' Fixes linting errors identified in code review. --- cmd/opts/opts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/opts/opts.go b/cmd/opts/opts.go index 50c564cc4..12462ea4d 100644 --- a/cmd/opts/opts.go +++ b/cmd/opts/opts.go @@ -1019,7 +1019,7 @@ type SCPOpts struct { } type SCPArgs struct { - Paths []string `positional-arg-name:"PATH" description:"Strings referencing remote (e.g. \":/some/remote/path\" -- \"user@host\" may be omitted) or local paths (e.g. \"./some/local/path\"). To target specific instances, a bosh instance selector (`instance-group/id`, e.g. router/1) can be used in place of host, e.g. `bosh scp router/1:/path/on/instance /tmp/local/path. See CLI documentation for more examples."` + Paths []string `positional-arg-name:"PATH" description:"Strings referencing remote (e.g. \":/some/remote/path\" -- \"user@host\" may be omitted) or local paths (e.g. \"./some/local/path\"). To target specific instances, a bosh instance selector (instance-group/id, e.g. router/1) can be used in place of host, e.g. 'bosh scp router/1:/path/on/instance /tmp/local/path'. See CLI documentation for more examples."` } type GatewayFlags struct {