WIP - update pip-command-usage to take optional arguments and update pip install docs
@@ -15,11 +15,15 @@ from pip._internal.req.req_file import SUPPORTED_OPTIONS
class PipCommandUsage(rst.Directive):
required_arguments = 1
+ optional_arguments = 4
def run(self):
cmd = create_command(self.arguments[0])
+ pip_cmd = '$ python -m pip'
+ if len(self.arguments) > 1:
+ pip_cmd = " ".join(self.arguments[1:])
usage = dedent(
- cmd.usage.replace('%prog', 'pip {}'.format(cmd.name))
+ cmd.usage.replace('%prog', '{} {}'.format(pip_cmd, cmd.name))
).strip()
node = nodes.literal_block(usage, usage)
return [node]
