Open ElSicarius opened 3 years ago
In addition, here are the arguments parsed by docopt showing the problem:
[___] BBRF internal, arguments of type <class 'str'> : url add -p test "https://example.com 200 2000" -t title:Cool_title
{'-': False,
'--all': False,
'--append-tags': False,
'--filter-cdns': False,
'--show-disabled': False,
'--show-empty-scope': False,
'--show-new': False,
'--top': False,
'--view': False,
'--wildcard': False,
'--with-query': False,
'-d': None,
'-p': 'test',
'-s': None,
'-t': ['title:Cool_title'],
'-y': False,
'<agent>': [],
'<document>': [],
'<domain>': [],
'<element>': [],
'<ip>': [],
'<message>': None,
'<name>': None,
'<program>': [],
'<service>': [],
'<tag_name>': None,
'<url>': ['"https://example.com', '200', '2000"'],
'<value>': None,
'<view>': None,
'active': False,
'add': True,
'after': False,
'agent': False,
'agents': False,
the differents recognized urls are : --> "https://example.com 200, and 2000"<-- (note the quotes included in the "urls")
Hi, While using BBRF client directly from the python package I came across an issue:
I tried the following code:
Stacktrace:
My understanding:
When passed to docopt directly line 76;bbrf.py:
Docopt parses the full str ignoring the quotes (").
The main problem is that a url should be processed like a sys.argv before giving it to docopt.
My workaround:
I'm using shlex to do the work of parsing the input parameters, and then i'm giving to docopt a list of arguments:
Thanks for this awesome tool !
Have a nice day