Skip to content

Empty error message when launching script without mandatory argument #17

Open
@CristianCantoro

Description

@CristianCantoro

With the latest docopts-go build:

#!/usr/bin/env bash
# file: atest.sh

arg=''

eval "$(./docopts -V - -h - : "$@" <<EOF
Usage: atest.sh <arg>
       atest.sh ( -h | --help )
       atest.sh ( -V | --version )

      arg				An argument.

Options:
      -h, --help        Show this help message and exits.
      -V, --version     Print version and copyright information.
----
atest 0.1.0
EOF
)"

echo "$arg"

If I launch the script without the mandatory argument no error message is shown:

$ ./atest.
error: 
Usage: atest.sh <arg>
       atest.sh ( -h | --help )
       atest.sh ( -V | --version )

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked by docopt parserdocopts uses an upper docopt parser which has a limitation. Parser must be improved.discussion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions