busctl: add "tree" command to explore object trees

This commit is contained in:
Lennart Poettering
2014-11-10 19:24:48 +01:00
parent ca5447c082
commit d9130355ee
3 changed files with 824 additions and 8 deletions

View File

@@ -143,6 +143,15 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
</listitem>
</varlistentry>
<varlistentry>
<term><option>--list</option></term>
<listitem>
<para>When used with the <command>tree</command> shows a
flat list of object paths instead of a tree.</para>
</listitem>
</varlistentry>
<xi:include href="user-system-options.xml" xpointer="user" />
<xi:include href="user-system-options.xml" xpointer="system" />
<xi:include href="user-system-options.xml" xpointer="host" />
@@ -163,8 +172,18 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<varlistentry>
<term><command>list</command></term>
<listitem><para>Show endpoints attached to the bus. This is
the default if no command is specified.</para></listitem>
<listitem><para>Show service names on the bus. This is the
default if no command is specified.</para></listitem>
</varlistentry>
<varlistentry>
<term><command>tree</command> <arg choice="opt" rep="repeat"><replaceable>NAME</replaceable></arg></term>
<listitem><para>Shows an object tree of one or more
services. If <replaceable>NAME</replaceable> is specified,
show object tree of the specified services only. Otherwise,
show all object trees of all services on the bus that acquired
at least one well-known name.</para></listitem>
</varlistentry>
<varlistentry>
@@ -193,7 +212,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<term><command>status</command> <arg choice="plain"><replaceable>NAME</replaceable></arg></term>
<listitem><para>Show process information and credentials of a
bus endpoint.</para></listitem>
bus service.</para></listitem>
</varlistentry>
<varlistentry>

File diff suppressed because it is too large Load Diff

View File

@@ -208,7 +208,7 @@ static int parse_argv(int argc, char *argv[]) {
assert_not_reached("Unhandled option");
}
if (arg_action == ACTION_INHIBIT && argc == 1)
if (arg_action == ACTION_INHIBIT && optind == argc)
arg_action = ACTION_LIST;
else if (arg_action == ACTION_INHIBIT && optind >= argc) {