core/command: filter instance selection by current display

This commit is contained in:
outfoxxed 2025-10-12 17:33:21 -07:00
parent 1e8cc2e78d
commit 00858812f2
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
9 changed files with 50 additions and 9 deletions

View file

@ -16,7 +16,7 @@ int parseCommand(int argc, char** argv, CommandState& state) {
.argv = argv,
};
auto addConfigSelection = [&](CLI::App* cmd, bool withNewestOption = false) {
auto addConfigSelection = [&](CLI::App* cmd, bool filtering = false) {
auto* group =
cmd->add_option_group("Config Selection")
->description(
@ -49,9 +49,13 @@ int parseCommand(int argc, char** argv, CommandState& state) {
->envname("QS_MANIFEST")
->excludes(path);
if (withNewestOption) {
if (filtering) {
group->add_flag("-n,--newest", state.config.newest)
->description("Operate on the most recently launched instance instead of the oldest");
group->add_flag("--any-display", state.config.anyDisplay)
->description("If passed, instances will not be filtered by the display connection they "
"were launched on.");
}
return group;