From 9b2aee4170c7bef4783b09c43d4051d6fdfa5eac Mon Sep 17 00:00:00 2001 From: David Tardon Date: Fri, 11 Oct 2019 14:39:56 +0200 Subject: [PATCH 1/2] udev/fido_id: fix program name in usage output --- src/udev/fido_id/fido_id.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/udev/fido_id/fido_id.c b/src/udev/fido_id/fido_id.c index 5afd5ddb80..83761d72b4 100644 --- a/src/udev/fido_id/fido_id.c +++ b/src/udev/fido_id/fido_id.c @@ -44,7 +44,7 @@ static int run(int argc, char **argv) { log_open(); if (argc > 2) - return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Usage: hidraw_id [SYSFS_PATH]"); + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Usage: %s [SYSFS_PATH]", program_invocation_short_name); if (argc == 1) { r = device_new_from_strv(&device, environ); From 9e385314b0917d496d7defc223c725eee03cc135 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Fri, 11 Oct 2019 14:41:58 +0200 Subject: [PATCH 2/2] udev: do not hardcode program name --- src/udev/ata_id/ata_id.c | 5 +++-- src/udev/cdrom_id/cdrom_id.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/udev/ata_id/ata_id.c b/src/udev/ata_id/ata_id.c index e5a9400eda..deeb939f54 100644 --- a/src/udev/ata_id/ata_id.c +++ b/src/udev/ata_id/ata_id.c @@ -425,9 +425,10 @@ int main(int argc, char *argv[]) { export = 1; break; case 'h': - printf("Usage: ata_id [--export] [--help] \n" + printf("Usage: %s [--export] [--help] \n" " -x,--export print values as environment keys\n" - " -h,--help print this help text\n\n"); + " -h,--help print this help text\n\n", + program_invocation_short_name); return 0; } } diff --git a/src/udev/cdrom_id/cdrom_id.c b/src/udev/cdrom_id/cdrom_id.c index a287901266..75afe4e7c9 100644 --- a/src/udev/cdrom_id/cdrom_id.c +++ b/src/udev/cdrom_id/cdrom_id.c @@ -849,12 +849,13 @@ int main(int argc, char *argv[]) { log_open(); break; case 'h': - printf("Usage: cdrom_id [options] \n" + printf("Usage: %s [options] \n" " -l,--lock-media lock the media (to enable eject request events)\n" " -u,--unlock-media unlock the media\n" " -e,--eject-media eject the media\n" " -d,--debug debug to stderr\n" - " -h,--help print this help text\n\n"); + " -h,--help print this help text\n\n", + program_invocation_short_name); goto exit; default: rc = 1;