aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/project/toolset.py
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-05-08 13:22:59 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-05-08 13:41:08 +0300
commit0cd2ca6a9a4d9cb9206297350e21934ed99d6280 (patch)
treee8caa5b6939a6b83c70913640dfc898577482c30 /project/toolset.py
parentv2.4 (diff)
downloadcmake-common-0cd2ca6a9a4d9cb9206297350e21934ed99d6280.tar.gz
cmake-common-0cd2ca6a9a4d9cb9206297350e21934ed99d6280.zip
remove the "-" between toolset and version
Diffstat (limited to '')
-rw-r--r--project/toolset.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/project/toolset.py b/project/toolset.py
index 5c5c414..0f94949 100644
--- a/project/toolset.py
+++ b/project/toolset.py
@@ -206,8 +206,6 @@ class ToolsetType(Enum):
class ToolsetVersion:
- _VERSION_SEP = '-'
-
def __init__(self, hint, version):
self.hint = hint
self.version = version
@@ -215,7 +213,7 @@ class ToolsetVersion:
def __str__(self):
if self.version is None:
return str(self.hint)
- return f'{self.hint}{ToolsetVersion._VERSION_SEP}{self.version}'
+ return f'{self.hint}{self.version}'
@staticmethod
def default():
@@ -247,13 +245,13 @@ class ToolsetVersion:
@staticmethod
def help_versioned_toolsets():
- s = '''Some toolsets support specifying a version using the [-VERSION] suffix. This
-is a list of all supported toolset versions:
+ s = '''Some toolsets support specifying a version using the VERSION suffix. This is
+a list of all supported toolset versions:
'''
for hint in ToolsetType.all_versioned():
for version in hint.all_versions():
- s += f' * {hint}{ToolsetVersion._VERSION_SEP}{version}\n'
+ s += f' * {hint}{version}\n'
return s
@staticmethod
@@ -262,8 +260,8 @@ is a list of all supported toolset versions:
return ToolsetVersion(ToolsetType(s), None)
except ValueError:
pass
- for hint in ToolsetType.all_versioned():
- prefix = f'{hint}{ToolsetVersion._VERSION_SEP}'
+ for hint in sorted(ToolsetType.all_versioned(), key=str, reverse=True):
+ prefix = f'{hint}'
if s.startswith(prefix):
return ToolsetVersion(hint, hint.parse_version(s[len(prefix):]))
raise argparse.ArgumentTypeError(f'invalid toolset: {s}')