Skip to content

Commit

Permalink
Merge f7edd9e into master
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored May 28, 2021
2 parents 9cd1007 + f7edd9e commit 0c706ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion vien/_constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "8.0.3"
__version__ = "8.0.4"
__copyright__ = "(c) 2020-2021 Artëm IG <github.com/rtmigo>"
__license__ = "BSD-3-Clause"

22 changes: 13 additions & 9 deletions vien/_parsed_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ def __init__(self, args: Optional[List[str]]):

parser = argparse.ArgumentParser()

parser.add_argument("--project-dir", "-p", default=None, type=str)
parser.add_argument("--project-dir", "-p", default=None, type=str,
help="the Python project directory "
"(default: current working directory). "
"Implicitly determines which virtual "
"environment should be used for the command")

# the following parameter is added only to avoid parsing errors.
# Actually we use its value from `args` before running ArgumentParser
Expand All @@ -96,36 +100,36 @@ def __init__(self, args: Optional[List[str]]):
subparsers = parser.add_subparsers(dest='command', required=True)

parser_init = subparsers.add_parser(Commands.create.name,
help="create new virtualenv")
help="create new virtual environment")
parser_init.add_argument('python', type=str, default=None,
nargs='?')

subparsers.add_parser(Commands.delete.name,
help="delete existing virtualenv")
help="delete existing environment")

parser_reinit = subparsers.add_parser(
Commands.recreate.name,
help="delete existing virtualenv and create new")
help="delete existing environment and create new")
parser_reinit.add_argument('python', type=str, default=None,
nargs='?')

if is_posix or enable_windows_all_args:
shell_parser = subparsers.add_parser(
Commands.shell.name,
help="dive into Bash sub-shell using the virtualenv")
help="dive into Bash sub-shell with the environment")
shell_parser.add_argument("--input", type=str, default=None)
shell_parser.add_argument("--delay", type=float, default=None,
help=argparse.SUPPRESS)

if is_posix or enable_windows_all_args:
parser_run = subparsers.add_parser(
Commands.run.name,
help="run a command inside the virtualenv")
help="run a shell command in the environment")
parser_run.add_argument('otherargs', nargs=argparse.REMAINDER)

parser_call = subparsers.add_parser(
Commands.call.name,
help="run a script inside the virtualenv")
help="run a .py file in the environment")
# todo Remove it later. [call -p] is outdated since 2021-05
parser_call.add_argument("--project-dir", "-p", default=None, type=str,
dest="outdated_call_project_dir",
Expand All @@ -136,8 +140,8 @@ def __init__(self, args: Optional[List[str]]):

subparsers.add_parser(
Commands.path.name,
help="show the supposed path of the virtualenv "
"for the current directory")
help="show the path of the environment "
"for the project")

if not args:
print(usage_doc())
Expand Down

0 comments on commit 0c706ac

Please sign in to comment.