DockerCLI/cli
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
..
command Singularize / pluralize "argument(s)" in error message 2017-08-12 18:25:38 +02:00
compose Merge pull request #360 from akalipetis/compose-update-order 2017-08-01 22:24:48 +02:00
config Rename NewConfigFile to New in configfile package 2017-06-27 16:31:38 +02:00
debug Import docker/docker/cli 2017-04-17 17:40:59 -04:00
flags Update cli imports to using local package 2017-05-15 14:45:19 +02:00
internal/test Fix presentation of published "random" host ports 2017-08-01 19:21:17 +02:00
trust Add unconvert linter 2017-06-14 16:54:27 -07:00
winresources Add windows resources to binary. 2017-05-15 18:03:03 -04:00
cobra.go fix docker/docker/cli path in comment 2017-04-24 11:31:08 -07:00
error.go Import docker/docker/cli 2017-04-17 17:40:59 -04:00
required.go Singularize / pluralize "argument(s)" in error message 2017-08-12 18:25:38 +02:00
required_test.go Singularize / pluralize "argument(s)" in error message 2017-08-12 18:25:38 +02:00
version.go Display proper version information 2017-05-09 14:22:51 -07:00