docs: better "server add" help output

This commit is contained in:
decentral1se 2024-06-25 09:24:01 +02:00
parent d787f71215
commit 1a12bef53e
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410

View File

@ -95,23 +95,19 @@ var serverAddCommand = cli.Command{
Description: ` Description: `
Add a new server to your configuration so that it can be managed by Abra. Add a new server to your configuration so that it can be managed by Abra.
Abra uses the SSH command-line to discover connection details for your server. Abra relies on the standard SSH command-line and ~/.ssh/config for client
It is advised to configure an entry per-host in your ~/.ssh/config for each connection details. You must configure an entry per-host in your ~/.ssh/config
server. For example: for each server. For example:
Host example.com example Host example.com example
Hostname example.com Hostname example.com
User exampleUser User exampleUser
Port 12345 Port 12345
IdentityFile ~/.ssh/example@somewhere IdentityFile ~/.ssh/example@somewhere
Abra can then load SSH connection details from this configuratiion with: You can then add a server like so:
abra server add example.com abra server add example.com
Or using the name "example" which is not resolvable on the public Internet:
abra server add -D example
If "--local" is passed, then Abra assumes that the current local server is If "--local" is passed, then Abra assumes that the current local server is
intended as the target server. This is useful when you want to have your entire intended as the target server. This is useful when you want to have your entire
@ -119,8 +115,10 @@ Co-op Cloud config located on the server itself, and not on your local
developer machine. The domain is then set to "default". developer machine. The domain is then set to "default".
You can also pass "--no-domain-checks/-D" flag to use any arbitrary name You can also pass "--no-domain-checks/-D" flag to use any arbitrary name
instead of a real domain. Host will be resolved with the "hostname" entry of instead of a real domain. The host will be resolved with the "Hostname" entry
your SSH configuration. Checks for a valid online domain will be skipped. of your ~/.ssh/config. Checks for a valid online domain will be skipped:
abra server add -D example
`, `,
Flags: []cli.Flag{ Flags: []cli.Flag{
internal.DebugFlag, internal.DebugFlag,
@ -129,7 +127,7 @@ your SSH configuration. Checks for a valid online domain will be skipped.
localFlag, localFlag,
}, },
Before: internal.SubCommandBefore, Before: internal.SubCommandBefore,
ArgsUsage: "<domain>", ArgsUsage: "<name>",
Action: func(c *cli.Context) error { Action: func(c *cli.Context) error {
if len(c.Args()) > 0 && local || !internal.ValidateSubCmdFlags(c) { if len(c.Args()) > 0 && local || !internal.ValidateSubCmdFlags(c) {
err := errors.New("cannot use <domain> and --local together") err := errors.New("cannot use <domain> and --local together")