From 6b6e82f8e9c11aeecbd47038a0c637ff5c8f8a1f Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 18 Jun 2009 14:52:45 +0300 Subject: Add -h/--help to rpm2cpio (ticket #63) - patch originally from Debian, with slight adjustments to indentation --- rpm2cpio.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'rpm2cpio.c') diff --git a/rpm2cpio.c b/rpm2cpio.c index eabefa170..e09838599 100644 --- a/rpm2cpio.c +++ b/rpm2cpio.c @@ -23,8 +23,13 @@ int main(int argc, char *argv[]) setprogname(argv[0]); /* Retrofit glibc __progname */ if (argc == 1) fdi = fdDup(STDIN_FILENO); - else + else { + if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) { + fprintf(stderr, "Usage: rpm2cpio file.rpm\n"); + exit(EXIT_FAILURE); + } fdi = Fopen(argv[1], "r.ufdio"); + } if (Ferror(fdi)) { fprintf(stderr, "%s: %s: %s\n", argv[0], -- cgit v1.2.3