@@ -16,7 +16,7 @@ int parseCommand(int argc, char** argv, CommandState& state) {
1616 .argv = argv,
1717 };
1818
19- auto addConfigSelection = [&](CLI::App* cmd) {
19+ auto addConfigSelection = [&](CLI::App* cmd, bool withNewestOption = false ) {
2020 auto * group = cmd->add_option_group (" Config Selection" )
2121 ->description (" If no options in this group are specified,\n "
2222 " $XDG_CONFIG_HOME/quickshell/shell.qml will be used." );
@@ -37,6 +37,11 @@ int parseCommand(int argc, char** argv, CommandState& state) {
3737 " otherwise it is the name of a folder in $XDG_CONFIG_HOME/quickshell." )
3838 ->envname (" QS_CONFIG_NAME" );
3939
40+ if (withNewestOption) {
41+ group->add_flag (" -n,--newest" , state.config .newest )
42+ ->description (" Operate on the most recently launched instance instead of the oldest" );
43+ }
44+
4045 return group;
4146 };
4247
@@ -146,7 +151,7 @@ int parseCommand(int argc, char** argv, CommandState& state) {
146151
147152 sub->add_flag (" -j,--json" , state.output .json , " Output the list as a json." );
148153
149- addConfigSelection (sub)->excludes (all);
154+ addConfigSelection (sub, true )->excludes (all);
150155 addLoggingOptions (sub, false , true );
151156
152157 state.subcommand .list = sub;
@@ -156,7 +161,7 @@ int parseCommand(int argc, char** argv, CommandState& state) {
156161 auto * sub = cli->add_subcommand (" kill" , " Kill quickshell instances." );
157162 // sub->add_flag("-a,--all", "Kill all matching instances instead of just one.");
158163 auto * instance = addInstanceSelection (sub);
159- addConfigSelection (sub)->excludes (instance);
164+ addConfigSelection (sub, true )->excludes (instance);
160165 addLoggingOptions (sub, false , true );
161166
162167 state.subcommand .kill = sub;
@@ -182,7 +187,7 @@ int parseCommand(int argc, char** argv, CommandState& state) {
182187 ->excludes (arguments);
183188
184189 auto * instance = addInstanceSelection (sub);
185- addConfigSelection (sub)->excludes (instance);
190+ addConfigSelection (sub, true )->excludes (instance);
186191 addLoggingOptions (sub, false , true );
187192
188193 sub->require_option ();
0 commit comments