The problem is that sys.argv has been stripped of quotes by the shell but docopt's arguments contains quotes.
So what we do is cycle through all docoptarguments: if they are also present in the joined sys.argv string and contain spaces, we add quotes to the strings we find.
The problem is that
sys.argv
has been stripped of quotes by the shell butdocopt
'sarguments
contains quotes.So what we do is cycle through all
docopt
arguments
: if they are also present in the joinedsys.argv
string and contain spaces, we add quotes to the strings we find.