DockerCLI/cli/command
Sebastiaan van Stijn b9a7f35e02
Singularize / pluralize "argument(s)" in error message
The validation functions to test for the number of passed arguments did not
pluralize `argument(s)`, and used `argument(s)` in all cases.

This patch adds a simple `pluralize()` helper to improve this.

Before this change, `argument(s)` was used in all cases:

    $ docker container ls foobar
    "docker container ls" accepts no argument(s).

    $ docker network create one two
    "docker network create" requires exactly 1 argument(s).

    $ docker network connect
    "docker network connect" requires exactly 2 argument(s).

    $ docker volume create one two
    "docker volume create" requires at most 1 argument(s).

After this change, `argument(s)` is properly singularized or plurarized:

    $ docker container ls foobar
    "docker container ls" accepts no arguments.

    $ docker network create one two
    "docker network create" requires exactly 1 argument.

    $ docker network connect
    "docker network connect" requires exactly 2 arguments.

    $ docker volume create one two
    "docker volume create" requires at most 1 argument.

Test cases were updated accordingly.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-12 18:25:38 +02:00
..
bundlefile Import docker/docker/cli 2017-04-17 17:40:59 -04:00
checkpoint Singularize / pluralize "argument(s)" in error message 2017-08-12 18:25:38 +02:00
commands Add support for configs 2017-05-11 13:42:49 -07:00
config Singularize / pluralize "argument(s)" in error message 2017-08-12 18:25:38 +02:00
container Import `docker/docker/pkg/templates` to cli 2017-08-08 17:26:24 +02:00
formatter Merge pull request #427 from vdemeester/import-templates-from-docker-pkg 2017-08-08 11:55:58 -04:00
idresolver cli: gofmt + goimports 2017-05-08 10:51:30 -07:00
image Singularize / pluralize "argument(s)" in error message 2017-08-12 18:25:38 +02:00
inspect Import `docker/docker/pkg/templates` to cli 2017-08-08 17:26:24 +02:00
network Singularize / pluralize "argument(s)" in error message 2017-08-12 18:25:38 +02:00
node Sort swarm stacks and nodes using natural sorting 2017-07-13 14:33:02 +03:00
plugin Update cli imports to using local package 2017-05-15 14:45:19 +02:00
registry login: add a --password-stdin argument 2017-07-11 12:16:29 -06:00
secret Singularize / pluralize "argument(s)" in error message 2017-08-12 18:25:38 +02:00
service Sort services names in a natural order 2017-07-19 18:18:06 +03:00
stack Fix presentation of published "random" host ports 2017-08-01 19:21:17 +02:00
swarm Singularize / pluralize "argument(s)" in error message 2017-08-12 18:25:38 +02:00
system Import `docker/docker/pkg/templates` to cli 2017-08-08 17:26:24 +02:00
task Update FakeCli to remove duplication in tests. 2017-07-11 14:49:30 -04:00
volume Singularize / pluralize "argument(s)" in error message 2017-08-12 18:25:38 +02:00
cli.go Enable TCP Keep-Alive in Docker client 2017-08-02 14:35:03 -07:00
events_utils.go Add deadcode linter. 2017-05-02 17:57:46 -04:00
in.go Fix docker run -it on windows 2017-05-03 18:41:19 -07:00
out.go Fix docker run -it on windows 2017-05-03 18:41:19 -07:00
registry.go Move credential getting functions to the ConfigFile. 2017-06-27 13:46:47 +02:00
registry_test.go Update some tests to remove unnecessary buffers. 2017-07-11 17:52:43 -04:00
stream.go Fix docker run -it on windows 2017-05-03 18:41:19 -07:00
trust.go Import docker/docker/cli 2017-04-17 17:40:59 -04:00
utils.go Add interfacer linter 2017-05-08 15:57:50 -04:00