From 0cd2ca6a9a4d9cb9206297350e21934ed99d6280 Mon Sep 17 00:00:00 2001
From: Egor Tensin <Egor.Tensin@gmail.com>
Date: Sat, 8 May 2021 13:22:59 +0300
Subject: remove the "-" between toolset and version

---
 project/toolset.py | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

(limited to 'project')

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}')
-- 
cgit v1.2.3