From 955c35b6a62f26e7ca36fa6378110ce7af8916a4 Mon Sep 17 00:00:00 2001 From: allencloud Date: Wed, 9 Nov 2016 14:22:06 +0800 Subject: [PATCH] add short flag for force Signed-off-by: allencloud --- cli/command/node/remove.go | 2 +- cli/command/swarm/leave.go | 2 +- docs/reference/commandline/node_rm.md | 6 +++--- docs/reference/commandline/swarm_leave.md | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cli/command/node/remove.go b/cli/command/node/remove.go index 3b89db8661..19b4a96631 100644 --- a/cli/command/node/remove.go +++ b/cli/command/node/remove.go @@ -29,7 +29,7 @@ func newRemoveCommand(dockerCli *command.DockerCli) *cobra.Command { }, } flags := cmd.Flags() - flags.BoolVar(&opts.force, "force", false, "Force remove a node from the swarm") + flags.BoolVarP(&opts.force, "force", "f", false, "Force remove a node from the swarm") return cmd } diff --git a/cli/command/swarm/leave.go b/cli/command/swarm/leave.go index ae13884154..1ffaa3fcc9 100644 --- a/cli/command/swarm/leave.go +++ b/cli/command/swarm/leave.go @@ -27,7 +27,7 @@ func newLeaveCommand(dockerCli *command.DockerCli) *cobra.Command { } flags := cmd.Flags() - flags.BoolVar(&opts.force, "force", false, "Force this node to leave the swarm, ignoring warnings") + flags.BoolVarP(&opts.force, "force", "f", false, "Force this node to leave the swarm, ignoring warnings") return cmd } diff --git a/docs/reference/commandline/node_rm.md b/docs/reference/commandline/node_rm.md index 1b1e4ba023..616be0a99b 100644 --- a/docs/reference/commandline/node_rm.md +++ b/docs/reference/commandline/node_rm.md @@ -16,7 +16,7 @@ keywords: "node, remove" # node rm ```markdown -Usage: docker node rm [OPTIONS] NODE [NODE...] +Usage: docker node rm [OPTIONS] NODE [NODE...] Remove one or more nodes from the swarm @@ -24,8 +24,8 @@ Aliases: rm, remove Options: - --force Force remove a node from the swarm - --help Print usage + -f, --force Force remove a node from the swarm + --help Print usage ``` When run from a manager node, removes the specified nodes from a swarm. diff --git a/docs/reference/commandline/swarm_leave.md b/docs/reference/commandline/swarm_leave.md index f0f31ee239..4dcccc6988 100644 --- a/docs/reference/commandline/swarm_leave.md +++ b/docs/reference/commandline/swarm_leave.md @@ -16,12 +16,12 @@ keywords: "swarm, leave" # swarm leave ```markdown -Usage: docker swarm leave [OPTIONS] +Usage: docker swarm leave [OPTIONS] -Leave the swarm (workers only). +Leave the swarm (workers only) Options: - --force Force this node to leave the swarm, ignoring warnings + -f, --force Force this node to leave the swarm, ignoring warnings --help Print usage ```