Skip to content

Commit

Permalink
support separating long arguments
Browse files Browse the repository at this point in the history
…into name and value, fixes amoffat#258
  • Loading branch information
minus7 committed May 29, 2015
1 parent 7a4e296 commit e743af1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sh.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,8 @@ class Command(object):
"cwd": None,

# the separator delimiting between a long-argument's name and its value
# setting this to None will cause name and value to be two separate
# arguments, like for short options
# for example, --arg=derp, '=' is the long_sep
"long_sep": "=",

Expand Down Expand Up @@ -856,6 +858,9 @@ def _aggregate_keywords(self, keywords, sep, raw=False):
processed.append(encode_to_py3bytes_or_py2str("--" + k))
elif v is False:
pass
elif sep is None:
processed.append(encode_to_py3bytes_or_py2str("--" + k))
processed.append(encode_to_py3bytes_or_py2str(v))
else:
arg = encode_to_py3bytes_or_py2str("--%s%s%s" % (k, sep, v))
processed.append(arg)
Expand Down

0 comments on commit e743af1

Please sign in to comment.