Commit Graph

43 Commits

Author SHA1 Message Date
0f80e9e5da Refactor utils/flags.go, fixes #11892
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 5670c6c6954e08575a6c821137a7ea6d9084af93
Component: engine
2015-03-29 03:22:46 +02:00
0913f2905d Changed snake case naming to camelCase
Signed-off-by: Peter Choi <phkchoi89@gmail.com>
Upstream-commit: ae907e7af16136225417242ef5d55d3f6062fb3b
Component: engine
2015-03-26 15:05:45 -06:00
b147bc8ddc Make use of %USERPROFILE% in cli help message
An earlier commit was causing docker windows CLI build to not to pick up
the shorthand form for home directory (`%USERPROFILE%`) shown in when
`docker --help` is executed.

Fixing that bug and making the if statement concise and clear.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 802c90500073ad79e5a6520402ef2a7268c824b7
Component: engine
2015-03-11 02:14:49 -07:00
5506a9a27c Remove subdirectories MAINTAINERS files
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 89bdaa35e04b74b7c6528783e0f7b8154b2a3d31
Component: engine
2015-03-06 18:21:51 -08:00
efffe9523d Fix for help when $HOME is /
estesp noticed that when $HOME is / the ~ substitutions messes up
becuase it tries to replace all paths that start with "/" with "~".
This fixes it so that it will only replace it when $HOME isn't "/".

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 116367eb07351125754aef01f7d3da152b018710
Component: engine
2015-02-19 22:21:17 -08:00
a45709a819 Shorten printed Windows paths on docker help cmd
This makes use of `%USERPROFILE%` as a substitute for
`~` on Windows and prints shorter strings for default
cert paths etc.

Also removes string escaping/quotes around default
path values printed in `docker help` command as they
are not really necessary and adds double backslashes
(\\) on windows.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 1c9b37cb965be459a93ce07539d7b2a53fbdbc6a
Component: engine
2015-02-18 23:04:56 -08:00
013dbb146f Pretty the help text
This modifies the "docker help" text so that it is no wider than 80 chars
and each description fits on one line. This will also try to use ~ when
possible

Added a test to make sure we don't go over 80 chars again.
Added a test to make sure we use ~

Applied rules/tests to all docker commands - not just main help text

Closes #10214

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 2203b37733e76d653cfe3b0ec5870786076adce7
Component: engine
2015-02-04 07:59:16 -08:00
dea4567bd2 correct the flag comments
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 00bd7b4c414061d71d7f94b5850cbe132da623f0
Component: engine
2015-01-13 15:40:24 +08:00
502d87f39d fix issue with goimport
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: b70632ec532d4a948e227a646f8286d7c439cb4f
Component: engine
2015-01-12 22:52:19 +00:00
8015360eaf update copyrights to 2015
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: e5869b2b0bdf85d15813c714565fd49943c3d754
Component: engine
2015-01-12 22:47:36 +00:00
319270793a Handle bad options better
* Do not log bad options error message twice, e.g.:

    $ docker run --pouet
    flag provided but not defined: --pouet
    See 'docker run --help'.
    2014/11/05 21:41:23 flag provided but not defined: --pouet

  With this patch just the first two lines will be produced.

* Print 'docker' just once when run without a command, e.g.:

    $ docker --hel
    flag provided but not defined: --hel
    See 'docker docker --help'.

Signed-off-by: Michal Minar <miminar@redhat.com>
Upstream-commit: 1d09fc22ca14b0b83bdc81cba06d3d7ac886a3e6
Component: engine
2015-01-06 13:44:27 +01:00
639170852f refactor redundant code around calls to cmd.Parse
Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: 41be2f73c7ce2cbb5450ee8bb35bf7235125ca63
Component: engine
2015-01-06 13:41:16 +01:00
bb1bfae794 Remove TestUsage, since Usage will no longer be shown on failure to parse
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 4dc962d09a05b5422c692f4762a32c24cb506e6b
Component: engine
2015-01-06 13:40:14 +01:00
f82eddabc6 --help option and help command should print to stdout not stderr
--help and help are successful commands so output should not go to error.

    QE teams have requested this change, also users doing docker help | less
    or docker run --help | less would expect this to work.

    Usage statement should only be printed when the user asks for it.
    Errors should print error message and then suggest the docker COMMAND --help
    command to see usage information.

    The current behaviour causes the user to have to search for the error message
    and sometimes scrolls right off the screen.  For example a error on a
    "docker run" command is very difficult to diagnose.

    Finally erros should always exit with a non 0 exit code, if the user
    makes a CLI error.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: a2b529ead21e6ab9eafcb1b1d2437c725c43a06a
Component: engine
2015-01-06 13:40:14 +01:00
86e291ef5c flag: fix the comments
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 9cc73c62e6779bf2c8eefc4192c017a2c73daf40
Component: engine
2014-11-30 01:58:16 +08:00
5dbc13abb8 Add missing unit testcase for new IsSet() func in mflag
Forgot to add this when I did PR #9259

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 88afbc4d94c4a803e936d602c620b8ab08e24acd
Component: engine
2014-11-22 05:37:36 -08:00
f7e2fcdfb9 Make --tlsverify enable tls regardless of value specified
I also needed to add a mflag.IsSet() function that allows you to check
to see if a certain flag was actually specified on the cmd line.

Per #9221 - also tweaked the docs to fix a typo.

Closes #9221

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: ae9bd580af55992974fcb94f73f72cc3b2257fec
Component: engine
2014-11-20 16:09:06 -08:00
5867aa701f fs.Visit() returns nil flag
Signed-off-by: Sven Dowideit <SvenDowideit@docker.com>
Upstream-commit: f1934e59790c9af6466075d3d050386627ad1a9a
Component: engine
2014-08-29 15:38:03 +10:00
3cca8404b4 add the [OPTIONS] string automatically if there are flags defined
Signed-off-by: SvenDowideit <SvenDowideit@home.org.au>

Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
Upstream-commit: 8c6c4a12b7bd53c01998988593789aa16a6d9ac8
Component: engine
2014-08-28 08:50:50 +10:00
676eea0fcd Revert "--help option and help command should print to stdout not stderr"
This reverts commit 61b129d81802e3c988cc0e67e488b24968dd748a.

Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 2e489073d94a7e2a5df115704a484c34f0b59f29
Component: engine
2014-08-27 18:59:13 +00:00
f13f1856df --help option and help command should print to stdout not stderr
--help and help are successful commands so output should not go to error.

QE teams have requested this change, also users doing docker help | less
or docker run --help | less would expect this to work.

Usage statement should only be printed when the user asks for it.
Errors should print error message and then suggest the docker COMMAND --help
command to see usage information.

The current behaviour causes the user to have to search for the error message
and sometimes scrolls right off the screen.  For example a error on a
"docker run" command is very difficult to diagnose.

Finally erros should always exit with a non 0 exit code, if the user
makes a CLI error.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 61b129d81802e3c988cc0e67e488b24968dd748a
Component: engine
2014-08-21 15:35:20 -04:00
6ae4c9014c update go import path and libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: b3ee9ac74e171e00f14027e39278013629e681b8
Component: engine
2014-07-24 22:19:50 +00:00
f94025a466 sort flags with the same name in a consistent order
Docker-DCO-1.1-Signed-off-by: Jonathan Boulle <jonathanboulle@gmail.com> (github: jonboulle)
Upstream-commit: d14cfc8d435dbef0d70b6444b275a025e60ac171
Component: engine
2014-06-27 01:46:59 +00:00
9a4ed6541e Merge pull request #6218 from vieux/update_maintainers
Upstream-commit: c9e647e42f3019b619b0ef47ff944831c226624c
Component: engine
2014-06-25 17:00:32 -07:00
172faefd3c Fix go vet errors
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: f08cd445b0d2e44a4977a3bd0dca0a1cd4e76d2f
Component: engine
2014-06-18 17:39:57 +00:00
2883b4234a prevent panic when empty flag
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 661a1e90263cc348c17620cf0b250bf552dd4056
Component: engine
2014-06-17 20:45:57 +00:00
86a79a73e0 update MAINTAINERS files
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 06248d745a6a69b14595a699e0e5b3e883d8ea3a
Component: engine
2014-06-16 22:20:07 +00:00
af5c1612d8 pkg: mflag: flag: added tests for quote-stripped flags
This patch adds some tests to ensure that quoted flags are properly
handled by the mflag package.

Docker-DCO-1.1-Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
Upstream-commit: e4497feaba31dd33bad790f77f783afc0c695020
Component: engine
2014-06-02 15:25:38 +10:00
460cf60260 pkg: mflag: flag: make mflag strip quotes in -flag="var" forms
This patch improves the mflag package to ensure that things arguments
to mflag such as `-flag="var"` or `-flag='var'` have the quotes
stripped from the value (to mirror the getopt functionality for similar
flags).

Docker-DCO-1.1-Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
Upstream-commit: 0e9c40eb8243fa437bc6c3e93aaff64a10cb856e
Component: engine
2014-06-02 15:25:33 +10:00
29bfaa0d20 use tabwriter to display usage in mflag
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 77098d5b5bf8840a1179380b34aedb26139b9d65
Component: engine
2014-05-06 21:31:21 +00:00
2fa4f2c621 update godoc and add MAINTAINERS for mflags
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: a41f6d936754f66d1786fa5b840278443da8d93c
Component: engine
2014-03-14 17:35:41 +00:00
8980d7490c improve deprecation message
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: f0eb227548427f6fc829f2b270ad83d22bd90c69
Component: engine
2014-03-12 00:51:46 +00:00
ddfc798df3 handle capital
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: 7da37fec13a0097284ffbbe05514de477cd98677
Component: engine
2014-03-07 23:40:45 +00:00
3398dcb261 improve alpha sort in mflag
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: 3729ece2ea1c4aad286b7535a7c137045a9da107
Component: engine
2014-03-07 02:20:59 +00:00
ceba53329c fix panic with only long flags or only one deprecatd
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: 069dc7f8c7bc3eaf61ddd926636aacce5f1ed1ee
Component: engine
2014-03-05 19:45:57 +00:00
fdbd555f75 fix usage for completly deprecated flag
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: 089bf5e11e4284a6ed07dc165098bb269dfddf46
Component: engine
2014-03-05 19:27:39 +00:00
b49fc1301e add warning for deprecatd flags
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: bb5ed452241c37ee9f2f3ebd02a2a5e1764334ad
Component: engine
2014-03-03 19:57:05 +00:00
5f84dbf6b9 prevent flag grouping with --
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: cb3d27d01bbf696929b4d77d10e47eca2693e3fa
Component: engine
2014-03-03 19:17:28 +00:00
66f4744981 enable docker run -it
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: 3839e3a0f63c8acc4cb11a87b862f159e5b2aedc
Component: engine
2014-02-24 22:53:00 +00:00
282ae4468c fix panic in mflag
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: 65794a2c4960f9065ee439d6823ffe670610dbb6
Component: engine
2014-01-31 11:39:29 -08:00
a9728be13d fix mflag import
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: c4e7b0e4d539c66f095d726856562c65f25eac0b
Component: engine
2014-01-27 23:29:56 +00:00
f68d62aa35 Fix mflag test issue with "ResetForTesting" (which only showed up under dyntest for some odd reason)
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
Upstream-commit: f60eee4894cfa07e8a969425c72d291f80f3053a
Component: engine
2014-01-23 13:03:17 -07:00
7822beced6 update commands.go
update docker.go

move to pkg

update docs

update name and copyright

change --sinceId to --since-id, update completion and docs

Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor@docker.com> (github: vieux)
Upstream-commit: e71dbf4ee5add5736f595948fc20bd01af56a744
Component: engine
2014-01-17 17:33:15 -08:00