Skip to content

Commit a3f1a2d

Browse files
committed
Update commands.go to remove the "#no-*" hacks
Docker-DCO-1.1-Signed-off-by: Andrew Page <[email protected]> (github: tianon)
1 parent 24beb29 commit a3f1a2d

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

api/client/commands.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
107107
cmd := cli.Subcmd("build", "[OPTIONS] PATH | URL | -", "Build a new container image from the source code at PATH")
108108
tag := cmd.String([]string{"t", "-tag"}, "", "Repository name (and optionally a tag) to be applied to the resulting image in case of success")
109109
suppressOutput := cmd.Bool([]string{"q", "-quiet"}, false, "Suppress the verbose output generated by the containers")
110-
noCache := cmd.Bool([]string{"#no-cache", "#-no-cache"}, false, "Do not use cache when building the image")
111-
*noCache = !*cmd.Bool([]string{"cache"}, true, "Use cache when building the image")
110+
noCache := !*cmd.Bool([]string{"cache"}, true, "Use cache when building the image")
112111
rm := cmd.Bool([]string{"#rm", "-rm"}, true, "Remove intermediate containers after a successful build")
113112
if err := cmd.Parse(args); err != nil {
114113
return nil
@@ -189,7 +188,7 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
189188
if isRemote {
190189
v.Set("remote", cmd.Arg(0))
191190
}
192-
if *noCache {
191+
if noCache {
193192
v.Set("nocache", "1")
194193
}
195194
if *rm {
@@ -853,7 +852,6 @@ func (cli *DockerCli) CmdHistory(args ...string) error {
853852
cmd := cli.Subcmd("history", "[OPTIONS] IMAGE", "Show the history of an image")
854853
quiet := cmd.Bool([]string{"q", "-quiet"}, false, "Only show numeric IDs")
855854
trunc := cmd.Bool([]string{"-trunc"}, true, "Truncate output")
856-
*trunc = !*cmd.Bool([]string{"#notrunc", "#-no-trunc"}, false, "Don't truncate output")
857855

858856
if err := cmd.Parse(args); err != nil {
859857
return nil
@@ -1141,7 +1139,6 @@ func (cli *DockerCli) CmdImages(args ...string) error {
11411139
quiet := cmd.Bool([]string{"q", "-quiet"}, false, "Only show numeric IDs")
11421140
all := cmd.Bool([]string{"a", "-all"}, false, "Show all images (by default filter out the intermediate image layers)")
11431141
trunc := cmd.Bool([]string{"-trunc"}, true, "Truncate output")
1144-
*trunc = !*cmd.Bool([]string{"#notrunc", "#-no-trunc"}, false, "Don't truncate output")
11451142

11461143
// FIXME: --viz and --tree are deprecated. Remove them in a future version.
11471144
flViz := cmd.Bool([]string{"#v", "#viz", "#-viz"}, false, "Output graph in graphviz format")
@@ -1343,7 +1340,6 @@ func (cli *DockerCli) CmdPs(args ...string) error {
13431340
size := cmd.Bool([]string{"s", "-size"}, false, "Display sizes")
13441341
all := cmd.Bool([]string{"a", "-all"}, false, "Show all containers. Only running containers are shown by default.")
13451342
trunc := cmd.Bool([]string{"-trunc"}, true, "Truncate output")
1346-
*trunc = !*cmd.Bool([]string{"#notrunc", "#-no-trunc"}, false, "Don't truncate output")
13471343
nLatest := cmd.Bool([]string{"l", "-latest"}, false, "Show only the latest created container, include non-running ones.")
13481344
since := cmd.String([]string{"#sinceId", "#-since-id", "-since"}, "", "Show only containers created since Id or Name, include non-running ones.")
13491345
before := cmd.String([]string{"#beforeId", "#-before-id", "-before"}, "", "Show only container created before Id or Name, include non-running ones.")
@@ -1629,7 +1625,6 @@ func (cli *DockerCli) CmdLogs(args ...string) error {
16291625
func (cli *DockerCli) CmdAttach(args ...string) error {
16301626
cmd := cli.Subcmd("attach", "[OPTIONS] CONTAINER", "Attach to a running container")
16311627
stdin := cmd.Bool([]string{"-stdin"}, true, "Attach stdin")
1632-
*stdin = !*cmd.Bool([]string{"#nostdin", "#-no-stdin"}, false, "Do not attach stdin")
16331628
proxy := cmd.Bool([]string{"#sig-proxy", "-sig-proxy"}, true, "Proxify all received signal to the process (even in non-tty mode)")
16341629
if err := cmd.Parse(args); err != nil {
16351630
return nil
@@ -1694,7 +1689,6 @@ func (cli *DockerCli) CmdAttach(args ...string) error {
16941689
func (cli *DockerCli) CmdSearch(args ...string) error {
16951690
cmd := cli.Subcmd("search", "TERM", "Search the docker index for images")
16961691
trunc := cmd.Bool([]string{"-trunc"}, true, "Truncate output")
1697-
*trunc = !*cmd.Bool([]string{"#notrunc", "#-no-trunc"}, false, "Don't truncate output")
16981692
trusted := cmd.Bool([]string{"t", "#trusted", "-trusted"}, false, "Only show trusted builds")
16991693
stars := cmd.Int([]string{"s", "#stars", "-stars"}, 0, "Only displays with at least xxx stars")
17001694
if err := cmd.Parse(args); err != nil {

0 commit comments

Comments
 (0)