如何使用 busctl 将 dbus 属性 设置为负值?
How do I set a dbus property to a negative value with busctl?
我正在尝试使用 busctl
将 double
类型的 属性 设置为负值。正值即可:
busctl set-property com.acme.foo /com/acme/foo com.acme.foo.Interface inflation d 1.0
但尝试将其更改为负值会出现以下错误:
busctl set-property com.acme.foo /com/acme/foo com.acme.foo.Interface inflation d -1.0
busctl: invalid option -- '1'
我已经尝试过一些显而易见的事情,比如将 -1.0
放在单引号、双引号中或使用反斜杠来转义 -
。有一个 --
选项,但似乎没有任何效果。
busctl -- set-property com.acme.foo /com/acme/foo com.acme.foo.Interface inflation d -1.0
-- 选项告诉 busctl -- 之后的所有内容都不是一个选项。与许多 unix 工具一样,busctl 使用 optarg 进行命令行解析。有关详细信息,请参阅 man optarg
。
我正在尝试使用 busctl
将 double
类型的 属性 设置为负值。正值即可:
busctl set-property com.acme.foo /com/acme/foo com.acme.foo.Interface inflation d 1.0
但尝试将其更改为负值会出现以下错误:
busctl set-property com.acme.foo /com/acme/foo com.acme.foo.Interface inflation d -1.0
busctl: invalid option -- '1'
我已经尝试过一些显而易见的事情,比如将 -1.0
放在单引号、双引号中或使用反斜杠来转义 -
。有一个 --
选项,但似乎没有任何效果。
busctl -- set-property com.acme.foo /com/acme/foo com.acme.foo.Interface inflation d -1.0
-- 选项告诉 busctl -- 之后的所有内容都不是一个选项。与许多 unix 工具一样,busctl 使用 optarg 进行命令行解析。有关详细信息,请参阅 man optarg
。