From 4de170ba9e393e04fb1fdeab073c575d8e957b13 Mon Sep 17 00:00:00 2001 From: Evan Hazlett Date: Mon, 23 Feb 2015 10:33:27 -0500 Subject: [PATCH 1/3] add better docs to command help Signed-off-by: Evan Hazlett --- commands.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/commands.go b/commands.go index 316b9bc8e5..ea58ab570d 100644 --- a/commands.go +++ b/commands.go @@ -183,17 +183,17 @@ var Commands = []cli.Command{ }, { Name: "inspect", - Usage: "Inspect information about a machine", + Usage: "Inspect information about a machine. Argument is a machine name. Will use the active machine if none is provided.", Action: cmdInspect, }, { Name: "ip", - Usage: "Get the IP address of a machine", + Usage: "Get the IP address of a machine. Argument is a machine name. Will use the active machine if none is provided.", Action: cmdIp, }, { Name: "kill", - Usage: "Kill a machine", + Usage: "Kill a machine. Argument is a machine name. Will use the active machine if none is provided.", Action: cmdKill, }, { @@ -209,7 +209,7 @@ var Commands = []cli.Command{ }, { Name: "restart", - Usage: "Restart a machine", + Usage: "Restart a machine. Argument is a machine name. Will use the active machine if none is provided.", Action: cmdRestart, }, { @@ -220,7 +220,7 @@ var Commands = []cli.Command{ }, }, Name: "rm", - Usage: "Remove a machine", + Usage: "Remove a machine. Argument is a machine name. Will use the active machine if none is provided.", Action: cmdRm, }, { @@ -236,26 +236,26 @@ var Commands = []cli.Command{ }, { Name: "ssh", - Usage: "Log into or run a command on a machine with SSH", + Usage: "Log into or run a command on a machine with SSH. Arguments are [machine-name] command. Will use the active machine if none is provided.", Action: cmdSsh, }, { Name: "start", - Usage: "Start a machine", + Usage: "Start a machine. Argument is a machine name. Will use the active machine if none is provided.", Action: cmdStart, }, { Name: "stop", - Usage: "Stop a machine", + Usage: "Stop a machine. Argument is a machine name. Will use the active machine if none is provided.", Action: cmdStop, }, { Name: "upgrade", - Usage: "Upgrade a machine to the latest version of Docker", + Usage: "Upgrade a machine to the latest version of Docker. Argument is a machine name. Will use the active machine if none is provided.", Action: cmdUpgrade, }, { - Name: "url", + Name: "url. Argument is a machine name. Will use the active machine if none is provided.", Usage: "Get the URL of a machine", Action: cmdUrl, }, From b71aad05011347ff7ae757c874ab13b8aeb03068 Mon Sep 17 00:00:00 2001 From: Evan Hazlett Date: Mon, 23 Feb 2015 11:14:02 -0500 Subject: [PATCH 2/3] fix help for url; formatting Signed-off-by: Evan Hazlett --- commands.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/commands.go b/commands.go index ea58ab570d..9de77ba906 100644 --- a/commands.go +++ b/commands.go @@ -172,7 +172,7 @@ var Commands = []cli.Command{ }, { Name: "config", - Usage: "Print the connection config for machine", + Usage: "Print the connection config for machine. Argument is a machine name. Will use the active machine if none is provided.", Action: cmdConfig, Flags: []cli.Flag{ cli.BoolFlag{ @@ -183,17 +183,17 @@ var Commands = []cli.Command{ }, { Name: "inspect", - Usage: "Inspect information about a machine. Argument is a machine name. Will use the active machine if none is provided.", + Usage: "Inspect information about a machine. Argument is a machine name. Will use the active machine if none is provided.", Action: cmdInspect, }, { Name: "ip", - Usage: "Get the IP address of a machine. Argument is a machine name. Will use the active machine if none is provided.", + Usage: "Get the IP address of a machine. Argument is a machine name. Will use the active machine if none is provided.", Action: cmdIp, }, { Name: "kill", - Usage: "Kill a machine. Argument is a machine name. Will use the active machine if none is provided.", + Usage: "Kill a machine. Argument is a machine name. Will use the active machine if none is provided.", Action: cmdKill, }, { @@ -209,7 +209,7 @@ var Commands = []cli.Command{ }, { Name: "restart", - Usage: "Restart a machine. Argument is a machine name. Will use the active machine if none is provided.", + Usage: "Restart a machine. Argument is a machine name. Will use the active machine if none is provided.", Action: cmdRestart, }, { @@ -220,7 +220,7 @@ var Commands = []cli.Command{ }, }, Name: "rm", - Usage: "Remove a machine. Argument is a machine name. Will use the active machine if none is provided.", + Usage: "Remove a machine. Argument is a machine name. Will use the active machine if none is provided.", Action: cmdRm, }, { @@ -236,27 +236,27 @@ var Commands = []cli.Command{ }, { Name: "ssh", - Usage: "Log into or run a command on a machine with SSH. Arguments are [machine-name] command. Will use the active machine if none is provided.", + Usage: "Log into or run a command on a machine with SSH. Arguments are [machine-name] command. Will use the active machine if none is provided.", Action: cmdSsh, }, { Name: "start", - Usage: "Start a machine. Argument is a machine name. Will use the active machine if none is provided.", + Usage: "Start a machine. Argument is a machine name. Will use the active machine if none is provided.", Action: cmdStart, }, { Name: "stop", - Usage: "Stop a machine. Argument is a machine name. Will use the active machine if none is provided.", + Usage: "Stop a machine. Argument is a machine name. Will use the active machine if none is provided.", Action: cmdStop, }, { Name: "upgrade", - Usage: "Upgrade a machine to the latest version of Docker. Argument is a machine name. Will use the active machine if none is provided.", + Usage: "Upgrade a machine to the latest version of Docker. Argument is a machine name. Will use the active machine if none is provided.", Action: cmdUpgrade, }, { - Name: "url. Argument is a machine name. Will use the active machine if none is provided.", - Usage: "Get the URL of a machine", + Name: "url", + Usage: "Get the URL of a machine. Argument is a machine name. Will use the active machine if none is provided.", Action: cmdUrl, }, } From cf1328ffb1eed81333710de24ca21430b300f676 Mon Sep 17 00:00:00 2001 From: Evan Hazlett Date: Mon, 23 Feb 2015 11:45:14 -0500 Subject: [PATCH 3/3] move extended help to command descriptions Signed-off-by: Evan Hazlett --- commands.go | 84 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 48 insertions(+), 36 deletions(-) diff --git a/commands.go b/commands.go index 9de77ba906..40d86c34e2 100644 --- a/commands.go +++ b/commands.go @@ -171,9 +171,10 @@ var Commands = []cli.Command{ Action: cmdCreate, }, { - Name: "config", - Usage: "Print the connection config for machine. Argument is a machine name. Will use the active machine if none is provided.", - Action: cmdConfig, + Name: "config", + Usage: "Print the connection config for machine", + Description: "Argument is a machine name. Will use the active machine if none is provided.", + Action: cmdConfig, Flags: []cli.Flag{ cli.BoolFlag{ Name: "swarm", @@ -182,19 +183,22 @@ var Commands = []cli.Command{ }, }, { - Name: "inspect", - Usage: "Inspect information about a machine. Argument is a machine name. Will use the active machine if none is provided.", - Action: cmdInspect, + Name: "inspect", + Usage: "Inspect information about a machine", + Description: "Argument is a machine name. Will use the active machine if none is provided.", + Action: cmdInspect, }, { - Name: "ip", - Usage: "Get the IP address of a machine. Argument is a machine name. Will use the active machine if none is provided.", - Action: cmdIp, + Name: "ip", + Usage: "Get the IP address of a machine", + Description: "Argument is a machine name. Will use the active machine if none is provided.", + Action: cmdIp, }, { - Name: "kill", - Usage: "Kill a machine. Argument is a machine name. Will use the active machine if none is provided.", - Action: cmdKill, + Name: "kill", + Usage: "Kill a machine", + Description: "Argument is a machine name. Will use the active machine if none is provided.", + Action: cmdKill, }, { Flags: []cli.Flag{ @@ -208,9 +212,10 @@ var Commands = []cli.Command{ Action: cmdLs, }, { - Name: "restart", - Usage: "Restart a machine. Argument is a machine name. Will use the active machine if none is provided.", - Action: cmdRestart, + Name: "restart", + Usage: "Restart a machine", + Description: "Argument is a machine name. Will use the active machine if none is provided.", + Action: cmdRestart, }, { Flags: []cli.Flag{ @@ -219,14 +224,16 @@ var Commands = []cli.Command{ Usage: "Remove local configuration even if machine cannot be removed", }, }, - Name: "rm", - Usage: "Remove a machine. Argument is a machine name. Will use the active machine if none is provided.", - Action: cmdRm, + Name: "rm", + Usage: "Remove a machine", + Description: "Argument is a machine name. Will use the active machine if none is provided.", + Action: cmdRm, }, { - Name: "env", - Usage: "Display the commands to set up the environment for the Docker client", - Action: cmdEnv, + Name: "env", + Usage: "Display the commands to set up the environment for the Docker client", + Description: "Argument is a machine name. Will use the active machine if none is provided.", + Action: cmdEnv, Flags: []cli.Flag{ cli.BoolFlag{ Name: "swarm", @@ -235,29 +242,34 @@ var Commands = []cli.Command{ }, }, { - Name: "ssh", - Usage: "Log into or run a command on a machine with SSH. Arguments are [machine-name] command. Will use the active machine if none is provided.", - Action: cmdSsh, + Name: "ssh", + Usage: "Log into or run a command on a machine with SSH", + Description: "Arguments are [machine-name] command - Will use the active machine if none is provided.", + Action: cmdSsh, }, { - Name: "start", - Usage: "Start a machine. Argument is a machine name. Will use the active machine if none is provided.", - Action: cmdStart, + Name: "start", + Usage: "Start a machine", + Description: "Argument is a machine name. Will use the active machine if none is provided.", + Action: cmdStart, }, { - Name: "stop", - Usage: "Stop a machine. Argument is a machine name. Will use the active machine if none is provided.", - Action: cmdStop, + Name: "stop", + Usage: "Stop a machine", + Description: "Argument is a machine name. Will use the active machine if none is provided.", + Action: cmdStop, }, { - Name: "upgrade", - Usage: "Upgrade a machine to the latest version of Docker. Argument is a machine name. Will use the active machine if none is provided.", - Action: cmdUpgrade, + Name: "upgrade", + Usage: "Upgrade a machine to the latest version of Docker", + Description: "Argument is a machine name. Will use the active machine if none is provided.", + Action: cmdUpgrade, }, { - Name: "url", - Usage: "Get the URL of a machine. Argument is a machine name. Will use the active machine if none is provided.", - Action: cmdUrl, + Name: "url", + Usage: "Get the URL of a machine", + Description: "Argument is a machine name. Will use the active machine if none is provided.", + Action: cmdUrl, }, }