Skip to content

Commit 3bc9aeb

Browse files
author
Michael Saki
committed
Refactor flag names for clarity and accuracy
This commit will remove the previous flags -v or --version for -p or --python-version. Also it will replace -n or --name for -v or --venv-name. The usage menu has been updated to reflect these changes as well.
1 parent 493a4a3 commit 3bc9aeb

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

setup-env

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ It does the following:
1919
- Configures git upstream remote "lineage" repositories.
2020
2121
Usage:
22-
setup-env (-n | --name) [virtual_env_name] (-v | --version) [python_version]
22+
setup-env [--venv-name virtual_env_name] [--python-version python_version]
2323
setup-env (-h | --help)
2424
2525
Options:
@@ -28,8 +28,8 @@ Options:
2828
-i | --install-hooks Install hook environments for all environments in the
2929
pre-commit config file.
3030
-l | --list-versions List available Python versions and select interactively.
31-
-n | --name Specify the name of the virtual environment.
32-
-v | --version Specify the Python version for the virtual environment.
31+
-v | --venv-name Specify the name of the virtual environment.
32+
-p | --python-version Specify the Python version for the virtual environment.
3333
3434
END_OF_LINE
3535
)
@@ -49,10 +49,10 @@ PYTHON_VERSION=""
4949
VENV_NAME=""
5050

5151
# Define long options
52-
LONGOPTS="force,help,install-hooks,list-versions,name:,version:"
52+
LONGOPTS="force,help,install-hooks,list-versions,python-version:,venv-name:"
5353

5454
# Define short options for getopt
55-
SHORTOPTS="fhiln:v:"
55+
SHORTOPTS="fhilp:v:"
5656

5757
# Check if GNU getopt is available
5858
if [[ $(getopt --version 2> /dev/null) != *"getopt from util-linux"* ]]; then
@@ -94,11 +94,7 @@ while true; do
9494
LIST_VERSIONS=1
9595
shift
9696
;;
97-
-n | --name)
98-
VENV_NAME="$2"
99-
shift 2
100-
;;
101-
-v | --version)
97+
-p | --python-version)
10298
PYTHON_VERSION="$2"
10399
shift 2
104100
# Check the Python versions being passed in.
@@ -113,6 +109,10 @@ while true; do
113109
fi
114110
fi
115111
;;
112+
-v | --venv-name)
113+
VENV_NAME="$2"
114+
shift 2
115+
;;
116116
--)
117117
shift
118118
break

0 commit comments

Comments
 (0)