Created
May 5, 2019 04:25
-
-
Save AlJohri/758a9b80ed4b1ebff311c4855990e294 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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