Skip to content

Commit 170be6d

Browse files
committed
fix problem with unrecognized command line arguments
1 parent 75bd863 commit 170be6d

File tree

4 files changed

+5
-13
lines changed

4 files changed

+5
-13
lines changed

src/compas_ghpython/components/__init__.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"""
2323
from __future__ import absolute_import
2424

25-
import argparse
2625
import glob
2726
import os
2827

@@ -34,14 +33,7 @@
3433

3534

3635
def get_version_from_args():
37-
parser = argparse.ArgumentParser()
38-
parser.add_argument(
39-
"-v",
40-
"--version",
41-
choices=compas_rhino.SUPPORTED_VERSIONS,
42-
default=compas_rhino.DEFAULT_VERSION,
43-
)
44-
args = parser.parse_args()
36+
args = compas_rhino.INSTALLATION_ARGUMENTS
4537
return _check_rhino_version(args.version)
4638

4739

src/compas_rhino/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
SUPPORTED_VERSIONS = ["5.0", "6.0", "7.0", "8.0"]
3939
DEFAULT_VERSION = "7.0"
4040

41+
INSTALLATION_ARGUMENTS = None
42+
4143
IRONPYTHON_PLUGIN_GUID = "814d908a-e25c-493d-97e9-ee3861957f49"
4244
GRASSHOPPER_PLUGIN_GUID = "b45a29b1-4343-4035-989e-044e8580d9cf"
4345
RHINOCYCLES_PLUGIN_GUID = "9bc28e9e-7a6c-4b8f-a0c6-3d05e02d1b97"

src/compas_rhino/install.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,9 @@ def _filter_installable_packages(version, packages):
372372
help="The version of Rhino to install the packages in.",
373373
)
374374
parser.add_argument("-p", "--packages", nargs="+", help="The packages to install.")
375-
parser.add_argument("--clean", dest="clean", default=False, action="store_true")
375+
parser.add_argument("-c", "--clean", default=False, action="store_true", help="Clean up the installation directory")
376376

377377
args = parser.parse_args()
378+
compas_rhino.INSTALLATION_ARGUMENTS = args
378379

379380
install(version=args.version, packages=args.packages, clean=args.clean)

src/compas_rhino/install_plugin.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
from .install import install as install_packages
99

1010

11-
__all__ = ["install_plugin"]
12-
13-
1411
def install_plugin(plugin, version=None):
1512
"""Install a Rhino Python Command Plugin.
1613

0 commit comments

Comments
 (0)