Commit graph

32 commits

Author SHA1 Message Date
Antonio Murdaca
2026dbd41d Small if err cleaning
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-27 21:50:33 +02:00
Antonio Murdaca
8b84610fdc Refactor utils/flags.go, fixes #11892
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-29 03:22:46 +02:00
Peter Choi
ecbb2a9d58 Changed snake case naming to camelCase
Signed-off-by: Peter Choi <phkchoi89@gmail.com>
2015-03-26 15:05:45 -06:00
Ahmet Alp Balkan
718f112173 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>
2015-03-11 02:14:49 -07:00
Doug Davis
9ac0da4578 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>
2015-02-19 22:21:17 -08:00
Ahmet Alp Balkan
78a51d2d2c 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>
2015-02-18 23:04:56 -08:00
Doug Davis
9bc2b3482b 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>
2015-02-04 07:59:16 -08:00
Qiang Huang
a3bca489d0 correct the flag comments
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-01-13 15:40:24 +08:00
Victor Vieux
288106b71b update copyrights to 2015
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-12 22:47:36 +00:00
Michal Minar
cfb25ffb10 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>
2015-01-06 13:44:27 +01:00
Tibor Vass
f23192465b refactor redundant code around calls to cmd.Parse
Signed-off-by: Tibor Vass <teabee89@gmail.com>
2015-01-06 13:41:16 +01:00
Dan Walsh
6c3b7f1932 --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)
2015-01-06 13:40:14 +01:00
Qiang Huang
16130e775f flag: fix the comments
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2014-11-30 01:58:16 +08:00
Doug Davis
0a3565494b 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>
2014-11-20 16:09:06 -08:00
Sven Dowideit
6a1cc969fc fs.Visit() returns nil flag
Signed-off-by: Sven Dowideit <SvenDowideit@docker.com>
2014-08-29 15:38:03 +10:00
SvenDowideit
cf3dfd3d8b 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)
2014-08-28 08:50:50 +10:00
Victor Vieux
bb2a94eeef update go import path and libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-07-24 22:19:50 +00:00
Jonathan Boulle
1d8231b230 sort flags with the same name in a consistent order
Docker-DCO-1.1-Signed-off-by: Jonathan Boulle <jonathanboulle@gmail.com> (github: jonboulle)
2014-06-27 01:46:59 +00:00
Victor Vieux
d18d9ffeaa prevent panic when empty flag
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-17 20:45:57 +00:00
cyphar
4941e364a9 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)
2014-06-02 15:25:33 +10:00
Victor Vieux
777139b650 use tabwriter to display usage in mflag
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-05-06 21:31:21 +00:00
Victor Vieux
eac9cae74d update godoc and add MAINTAINERS for mflags
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-03-14 17:35:41 +00:00
Victor Vieux
f7fe084946 improve deprecation message
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-03-12 00:51:46 +00:00
Victor Vieux
572ce1c6a9 handle capital
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-03-07 23:40:45 +00:00
Victor Vieux
6c4652a766 improve alpha sort in mflag
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-03-07 02:20:59 +00:00
Victor Vieux
7339ca8699 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)
2014-03-05 19:45:57 +00:00
Victor Vieux
a5ba28e1f7 fix usage for completly deprecated flag
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-03-05 19:27:39 +00:00
Victor Vieux
ed2e85ad24 add warning for deprecatd flags
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-03-03 19:57:05 +00:00
Victor Vieux
d1b77040a7 prevent flag grouping with --
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-03-03 19:17:28 +00:00
Victor Vieux
8a05149d91 enable docker run -it
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-02-24 22:53:00 +00:00
Victor Vieux
84a91cabdd fix panic in mflag
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-31 11:39:29 -08:00
Victor Vieux
e15a64d1a2 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)
2014-01-17 17:33:15 -08:00