Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Failes to parse forward slashes #80

Closed
runarberg opened this issue Oct 14, 2016 · 1 comment
Closed

Failes to parse forward slashes #80

runarberg opened this issue Oct 14, 2016 · 1 comment

Comments

@runarberg
Copy link
Contributor

runarberg commented Oct 14, 2016

I am writing a CLI and am considering hierarchical command structure, such that a top level help would look like…

cli-tool

usage:
    cli-tool <command>
    cli-tool --list

options:
    --list    List available commands

…and a help for a given command foo would look like

cli-tool foo

usage:
    cli-tool foo --list

options:
    --list    List available commands under 'foo'

Say cli-tool --list would yield:

foo/bar
foo/baz

and the help for the foo/bar sub-command looks like:

cli-tool foo/bar

usage:
    cli-tool foo/bar

For the last example I get an error:

Failed to parse specification:
Unexpected input: /bar

Turns out that the parser is only able to accept a very narrow range of ASCII alphanumerical characters plus a dot ., the hyphen - and the underscore _.

Note that in docopt forward slashes / are OK in usage examples.

@felixSchl
Copy link
Owner

felixSchl commented Oct 14, 2016

I have never seen / used a command line utility that uses a "/", so I did not catch it. I don't mind adding this in, but I expect there will be many more such cases. I agree losening this up is a good idea, going from inclusive to an exclusive set of allowed characters.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants