forked from quickshell/quickshell
io/ipchandler: add prop get
This commit is contained in:
parent
9417d6fa57
commit
4f2610dece
10 changed files with 262 additions and 31 deletions
|
@ -293,6 +293,8 @@ int ipcCommand(CommandState& cmd) {
|
|||
return IpcClient::connect(instance.instance.instanceId, [&](IpcClient& client) {
|
||||
if (*cmd.ipc.show || cmd.ipc.showOld) {
|
||||
return qs::io::ipc::comm::queryMetadata(&client, *cmd.ipc.target, *cmd.ipc.name);
|
||||
} else if (*cmd.ipc.getprop) {
|
||||
return qs::io::ipc::comm::getProperty(&client, *cmd.ipc.target, *cmd.ipc.name);
|
||||
} else {
|
||||
QVector<QString> arguments;
|
||||
for (auto& arg: cmd.ipc.arguments) {
|
||||
|
|
|
@ -71,6 +71,7 @@ struct CommandState {
|
|||
CLI::App* ipc = nullptr;
|
||||
CLI::App* show = nullptr;
|
||||
CLI::App* call = nullptr;
|
||||
CLI::App* getprop = nullptr;
|
||||
bool showOld = false;
|
||||
QStringOption target;
|
||||
QStringOption name;
|
||||
|
|
|
@ -194,6 +194,18 @@ int parseCommand(int argc, char** argv, CommandState& state) {
|
|||
->description("Arguments to the called function.")
|
||||
->allow_extra_args();
|
||||
}
|
||||
|
||||
{
|
||||
auto* prop =
|
||||
sub->add_subcommand("prop", "Manipulate IpcHandler properties.")->require_subcommand();
|
||||
|
||||
{
|
||||
auto* get = prop->add_subcommand("get", "Read the value of a property.");
|
||||
state.ipc.getprop = get;
|
||||
get->add_option("target", state.ipc.target, "The target to read the property of.");
|
||||
get->add_option("property", state.ipc.name)->description("The property to read.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue