2014-07-06 23:22 GMT+02:00 Zbigniew Jędrzejewski-Szmek <[email protected]>:
> On Sun, Jul 06, 2014 at 10:28:55PM +0200, Michael Biebl wrote:
>> +#include <stdio.h>
>> +#include <stdlib.h>
>> +
>> +#include "log.h"
>> +#include "unit-name.h"
>> +
>> +int main(int argc, char *argv[]) {
>> + char *escaped_name = NULL;
>> +
>> + if (argc != 2) {
>> + log_error("This program requires on argument.");
> "an" or "one"?
Ah, right. Thanks for spotting that typo.
>
>> + return EXIT_FAILURE;
>> + }
>> +
>> + escaped_name = unit_name_escape(argv[1]);
>> +
>> + if (!escaped_name) {
>> + log_error("Failed to escape name.");
> Maybe just log_oom()?
Ok.
>> + return EXIT_FAILURE;
>> + }
>> +
>> + printf("%s", escaped_name);
>> +
>> + return EXIT_SUCCESS;
>
> What about adding a --template parameter, to be used as
>
> systemd-escape --template [email protected] /some/path ->
> [email protected]
Why not. Let me add that including a short man page.
Cheers,
Michael
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel