mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-10 04:50:31 -04:00
feat(universal-binary): allow version suffix on symlinks/copies
This commit is contained in:
parent
db75114105
commit
33ed66ce0a
@ -68,6 +68,18 @@ int SYS_MAIN(int argc, sys_char** argv) {
|
||||
if (auto it = functions.find(stem); it != functions.end()) {
|
||||
return safe_main([&] { return it->second(argc, argv); });
|
||||
}
|
||||
|
||||
// see if the stem has an appended version and try removing that
|
||||
if (auto pos = stem.find_first_of('-'); pos != std::string::npos &&
|
||||
pos + 1 < stem.size() &&
|
||||
std::isdigit(stem[pos + 1])) {
|
||||
if (auto it = functions.find(stem.substr(0, pos));
|
||||
it != functions.end()) {
|
||||
std::cerr << "running " << stem << " as " << stem.substr(0, pos)
|
||||
<< "\n";
|
||||
return safe_main([&] { return it->second(argc, argv); });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if not, see if we can find a --tool=... argument
|
||||
|
Loading…
x
Reference in New Issue
Block a user