[systemd-devel] systemctl escaping of unit names

Lennart Poettering lennart at poettering.net
Mon Jul 7 13:54:21 PDT 2014


On Mon, 07.07.14 12:50, Lennart Poettering (lennart at poettering.net) wrote:

> On Sun, 06.07.14 22:28, Michael Biebl (mbiebl at gmail.com) wrote:
> 
> > +        if (argc != 2) {
> > +                log_error("This program requires on argument.");
> > +                return EXIT_FAILURE;
> > +        }
> > +
> > +        escaped_name = unit_name_escape(argv[1]);
> 
> I'd prefer if we'd do this for all arguments passed. 
> 
> Also, as mentioned earlier, please also add a switch for undoing
> escaping, and even better also for simply unit_name_mangle() logic.
> 
> Also, --help, man page, ...

I have now committed your original patch and beefed it up
considerably. Added Zbigniew's --template= switch, and a couple of other
things. Also added docs, with a few examples.

http://www.freedesktop.org/software/systemd/man/systemd-escape.html

Enjoy!

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list