Improve bosh scp -h#693
Conversation
- 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).
|
I think it would be helpful to have an example of the more common case of |
I agree, not sure this is the right place for it? I think there's no existing hooks for invocation examples, and shoving a full invocation example into an argument description feels a bit weird to me. The problem I was trying to solve here is I was like "OK, I know I want to bosh scp, and I'm familiar with scp, but how does this work when I don't have the username/host -- what am I supposed to do?". I think the remote path example provides enough of a hint to let you solve that problem. That said, my use case was director-tied (I was trying to |
|
Right, in non-director cases it would be something like |
|
|
||
| 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."` |
There was a problem hiding this comment.
Actually IMHO I would rather name it differently:
Usage:
bosh [OPTIONS] scp [scp-OPTIONS] source ... target
The same way a typical scp command would also describe it. I see it is technically one array, but it better describes how it can actually be used
There was a problem hiding this comment.
@ragaskar - are you ok with switching the the scp style documentation, instead of the example-based version in this PR?
Co-authored-by: Alexander Lais <Alexander.lais@me.com>
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.
Fix linting errors in improve_help_scp branch
|
@aramprice are you okey with merging now that the checks are passing? |
bosh scpcommand. 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).Below is an example of the current help for PATH, followed by the new display after this patch is applied:
Existing help:
Proposed Update
(see PATH near end of output)