Closed pihentagy closed 3 years ago
Hi @pihentagy
I think it's a problem with the version of docopt_get_help_string
and the version of awk
it should work with GNU awk
but not mawk
.
If I save your example in t2.sh
$ . docopts.sh
$ docopt_get_help_string ./t2.sh
# Usage:
# create_workload_user -h | --help
# create_workload_user
# create_workload_user [--provider=<provider>] <workload_user>
#
# Options:
# --provider=<provider> Provider used, valid choices are vagrant and docker [default: vagrant]
#
But after installing gawk:
$ docopt_get_help_string ./t2.sh
Usage:
create_workload_user -h | --help
create_workload_user
create_workload_user [--provider=<provider>] <workload_user>
Options:
--provider=<provider> Provider used, valid choices are vagrant and docker [default: vagrant]
The dash from the comment are removed. I must issue this bug. You can try this dirty patch. I must also test mac version.
diff --git a/docopts.sh b/docopts.sh
index 3b7bf55..1208489 100644
--- a/docopts.sh
+++ b/docopts.sh
@@ -71,7 +71,7 @@ docopt_get_help_string() {
print usage[i]
}
}
- ' < "$myfname"
+ ' < "$myfname" | sed -e 's/^#//' -e 's/^# //'
}
# Doc:
The error message given is too terse for me.
Could you elaborate when can I get this error message?
Note, that this works on another machine (with other version of bash)
Relevant script part: