diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-07-18 05:30:57 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2020-11-03 11:39:02 -0500 |
| commit | f4ca82f798fa7e456bb904ed301ddc17db5410c8 (patch) | |
| tree | 4f27efe8f211ba5eb81a5e728b8d5d4ae7de4ed5 /src/commandline.cpp | |
| parent | ccab9eae8df3cf5367ce5cf164c98d1534ac13cb (diff) | |
fixed handling of profile names with different casing than on the filesystem
added --instance
Diffstat (limited to 'src/commandline.cpp')
| -rw-r--r-- | src/commandline.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/commandline.cpp b/src/commandline.cpp index f5c4df60..11f43dea 100644 --- a/src/commandline.cpp +++ b/src/commandline.cpp @@ -120,6 +120,7 @@ void CommandLine::createOptions() m_visibleOptions.add_options() ("help", "show this message") ("multiple", "allow multiple instances of MO to run; see below") + ("instance,i", po::value<std::string>(), "use the given instance (defaults to last used)") ("profile,p", po::value<std::string>(), "use the given profile (defaults to last used)"); po::options_description options; @@ -187,6 +188,17 @@ std::optional<QString> CommandLine::profile() const return {}; } +std::optional<QString> CommandLine::instance() const +{ + if (m_shortcut.isValid() && m_shortcut.hasInstance()) { + return m_shortcut.instance(); + } else if (m_vm.count("instance")) { + return QString::fromStdString(m_vm["instance"].as<std::string>()); + } + + return {}; +} + const MOShortcut& CommandLine::shortcut() const { return m_shortcut; |
