@@ -135,7 +135,7 @@ int parseCommand(int argc, char** argv, CommandState& state) {
135135 ->description (" Rules to apply to the log being read, in the format of QT_LOGGING_RULES." );
136136
137137 auto * instance = addInstanceSelection (sub)->excludes (file);
138- addConfigSelection (sub)->excludes (instance)->excludes (file);
138+ addConfigSelection (sub, true )->excludes (instance)->excludes (file);
139139 addLoggingOptions (sub, false );
140140
141141 state.subcommand .log = sub;
@@ -168,30 +168,53 @@ int parseCommand(int argc, char** argv, CommandState& state) {
168168 }
169169
170170 {
171- auto * sub = cli->add_subcommand (" msg" , " Send messages to IpcHandlers." )->require_option ();
171+ auto * sub = cli->add_subcommand (" ipc" , " Communicate with other Quickshell instances." )
172+ ->require_subcommand ();
173+ state.ipc .ipc = sub;
172174
173- auto * target = sub->add_option (" target" , state.ipc .target , " The target to message." );
175+ auto * instance = addInstanceSelection (sub);
176+ addConfigSelection (sub, true )->excludes (instance);
177+ addLoggingOptions (sub, false , true );
178+
179+ {
180+ auto * show = sub->add_subcommand (" show" , " Print information about available IPC targets." );
181+ state.ipc .show = show;
182+ }
183+
184+ {
185+ auto * call = sub->add_subcommand (" call" , " Call an IpcHandler function." );
186+ state.ipc .call = call;
174187
175- auto * function = sub->add_option (" function" , state.ipc .function )
176- ->description (" The function to call in the target." )
177- ->needs (target);
188+ call->add_option (" target" , state.ipc .target , " The target to message." );
178189
179- auto * arguments = sub->add_option (" arguments" , state.ipc .arguments )
180- ->description (" Arguments to the called function." )
181- ->needs (function)
182- ->allow_extra_args ();
190+ call->add_option (" function" , state.ipc .name )
191+ ->description (" The function to call in the target." );
183192
184- sub->add_flag (" -s,--show" , state.ipc .info )
193+ call->add_option (" arguments" , state.ipc .arguments )
194+ ->description (" Arguments to the called function." )
195+ ->allow_extra_args ();
196+ }
197+ }
198+
199+ {
200+ auto * sub = cli->add_subcommand (" msg" , " [DEPRECATED] Moved to `ipc call`." )->require_option ();
201+
202+ sub->add_option (" target" , state.ipc .target , " The target to message." );
203+
204+ sub->add_option (" function" , state.ipc .name )->description (" The function to call in the target." );
205+
206+ sub->add_option (" arguments" , state.ipc .arguments )
207+ ->description (" Arguments to the called function." )
208+ ->allow_extra_args ();
209+
210+ sub->add_flag (" -s,--show" , state.ipc .showOld )
185211 ->description (" Print information about a function or target if given, or all available "
186- " targets if not." )
187- ->excludes (arguments);
212+ " targets if not." );
188213
189214 auto * instance = addInstanceSelection (sub);
190215 addConfigSelection (sub, true )->excludes (instance);
191216 addLoggingOptions (sub, false , true );
192217
193- sub->require_option ();
194-
195218 state.subcommand .msg = sub;
196219 }
197220
0 commit comments