[systemd-devel] Bug#727708: [PATCH] systemctl: allow globbing in commands which take multiple unit names

Lennart Poettering lennart at poettering.net
Thu Dec 26 09:49:31 PST 2013


On Thu, 26.12.13 17:39, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:

> As discussed on IRC, here's a patch which takes the simple approach of
> allowing globbing on loaded unit names in various (almost all :)) systemctl
> commands. Comments?

Looks good. But maybe an additional warning should be printed if people
use globs on the "systemctl start" command line? Some shorter version of
the blurb you added to the man page? i am pretty sure people will run
into this problem, and we should tell them what is going on...

> +bool string_is_glob(const char *p) {
> +        return strchr(p, '*') || strchr(p, '?') || strchr(p, '[');
> +}
> +

This looks prettier:

    #define GLOB_CHARS "*=["

    bool string_is_glob(const char *p) {
            return !!strpbrk(p, GLOB_CHARS);
    }

The macro should probably live in the header, next to ther others... And
maybe the function too as static inline? given that is is just one
function call internally that sounds pretty ok as static inline call?

Lennart

-- 
Lennart Poettering, Red Hat


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST at lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster at lists.debian.org




More information about the systemd-devel mailing list