DockerCLI/cli/command/network
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
..
client_test.go adding connect disconnect network tests 2017-07-20 18:53:03 +02:00
cmd.go adding unit tests to network 2017-07-06 00:54:30 +02:00
connect.go adding unit tests to network 2017-07-06 00:54:30 +02:00
connect_test.go Singularize / pluralize "argument(s)" in error message 2017-08-12 18:25:38 +02:00
create.go adding unit tests to network 2017-07-06 00:54:30 +02:00
create_test.go Update some tests to remove unnecessary buffers. 2017-07-11 17:52:43 -04:00
disconnect.go adding unit tests to network 2017-07-06 00:54:30 +02:00
disconnect_test.go Singularize / pluralize "argument(s)" in error message 2017-08-12 18:25:38 +02:00
inspect.go adding unit tests to network 2017-07-06 00:54:30 +02:00
list.go adding unit tests to network 2017-07-06 00:54:30 +02:00
prune.go Update cli imports to using local package 2017-05-15 14:45:19 +02:00
remove.go adding unit tests to network 2017-07-06 00:54:30 +02:00