From 2b31a4bf8d6b80ca2ca51c96e822dcd5832592f9 Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Wed, 19 Apr 2017 21:35:00 -0500 Subject: [PATCH] Output `docker swarm join` on a single line This avoids issues when copy/pasting between different shells on different OSes, which may not all support `\` as a continuation character. Fixes #32725 Signed-off-by: Dave Henderson --- cli/command/swarm/join_token.go | 4 ++-- cli/command/swarm/testdata/jointoken-manager-rotate.golden | 5 +---- cli/command/swarm/testdata/jointoken-manager.golden | 5 +---- cli/command/swarm/testdata/jointoken-worker.golden | 5 +---- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/cli/command/swarm/join_token.go b/cli/command/swarm/join_token.go index 0a905dfc26..b35efad8a9 100644 --- a/cli/command/swarm/join_token.go +++ b/cli/command/swarm/join_token.go @@ -108,10 +108,10 @@ func printJoinCommand(ctx context.Context, dockerCli command.Cli, nodeID string, if node.ManagerStatus != nil { if worker { - fmt.Fprintf(dockerCli.Out(), "To add a worker to this swarm, run the following command:\n\n docker swarm join \\\n --token %s \\\n %s\n\n", sw.JoinTokens.Worker, node.ManagerStatus.Addr) + fmt.Fprintf(dockerCli.Out(), "To add a worker to this swarm, run the following command:\n\n docker swarm join --token %s %s\n\n", sw.JoinTokens.Worker, node.ManagerStatus.Addr) } if manager { - fmt.Fprintf(dockerCli.Out(), "To add a manager to this swarm, run the following command:\n\n docker swarm join \\\n --token %s \\\n %s\n\n", sw.JoinTokens.Manager, node.ManagerStatus.Addr) + fmt.Fprintf(dockerCli.Out(), "To add a manager to this swarm, run the following command:\n\n docker swarm join --token %s %s\n\n", sw.JoinTokens.Manager, node.ManagerStatus.Addr) } } diff --git a/cli/command/swarm/testdata/jointoken-manager-rotate.golden b/cli/command/swarm/testdata/jointoken-manager-rotate.golden index 7ee455bec8..b4d0a48f66 100644 --- a/cli/command/swarm/testdata/jointoken-manager-rotate.golden +++ b/cli/command/swarm/testdata/jointoken-manager-rotate.golden @@ -2,7 +2,4 @@ Successfully rotated manager join token. To add a manager to this swarm, run the following command: - docker swarm join \ - --token manager-join-token \ - 127.0.0.1 - + docker swarm join --token manager-join-token 127.0.0.1 diff --git a/cli/command/swarm/testdata/jointoken-manager.golden b/cli/command/swarm/testdata/jointoken-manager.golden index d56527aa55..522b2968fe 100644 --- a/cli/command/swarm/testdata/jointoken-manager.golden +++ b/cli/command/swarm/testdata/jointoken-manager.golden @@ -1,6 +1,3 @@ To add a manager to this swarm, run the following command: - docker swarm join \ - --token manager-join-token \ - 127.0.0.1 - + docker swarm join --token manager-join-token 127.0.0.1 diff --git a/cli/command/swarm/testdata/jointoken-worker.golden b/cli/command/swarm/testdata/jointoken-worker.golden index 5d44f3daee..899df703fd 100644 --- a/cli/command/swarm/testdata/jointoken-worker.golden +++ b/cli/command/swarm/testdata/jointoken-worker.golden @@ -1,6 +1,3 @@ To add a worker to this swarm, run the following command: - docker swarm join \ - --token worker-join-token \ - 127.0.0.1 - + docker swarm join --token worker-join-token 127.0.0.1