Skip to content

Instantly share code, notes, and snippets.

@AlJohri
Created May 5, 2019 04:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlJohri/758a9b80ed4b1ebff311c4855990e294 to your computer and use it in GitHub Desktop.
Save AlJohri/758a9b80ed4b1ebff311c4855990e294 to your computer and use it in GitHub Desktop.
import sys
import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument('command', choices=['userpath'])
parser.add_argument('--verbose')
parser.add_argument('--flag', action='store_true', default=False)
args, subcommand_args = parser.parse_known_args()
if args.command == 'userpath':
if len(subcommand_args) == 0:
print('pipx vendors in the userpath command. run all commands with'
'pipx userpath ...')
print('see the userpath help below:\n')
subprocess.run([sys.executable, '-m', 'userpath', '--help'])
exit(1)
subprocess.run([sys.executable, '-m', 'userpath', *subcommand_args], check=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment