summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-08-24 21:08:04 +0200
committerLennart Poettering <lennart@poettering.net>2015-08-24 22:46:45 +0200
commitfee6d013d859bc66f5c993530898fece53fab06d (patch)
treed3b7d27fbaf9d734b3450ee2c6219c162aba8543 /src
parentfbe550738d03b178bb004a1390e74115e904118a (diff)
machinectl: don't show ".host" pseudo-machine in list by default
Let's hide all machines whose name begins with "." by default, thus hiding the ".host" pseudo-machine, unless --all is specified. This takes inspiration from the ".host" image handling in "machinectl list-images" which also hides all images whose name starts with ".".
Diffstat (limited to 'src')
-rw-r--r--src/machine/machinectl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index c84deba1c0..0f9e732ada 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -158,6 +158,9 @@ static int list_machines(int argc, char *argv[], void *userdata) {
while ((r = sd_bus_message_read(reply, "(ssso)", &name, &class, &service, &object)) > 0) {
size_t l;
+ if (name[0] == '.' && !arg_all)
+ continue;
+
if (!GREEDY_REALLOC(machines, n_allocated, n_machines + 1))
return log_oom();