summaryrefslogtreecommitdiff
path: root/rpm2cpio.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-06-18 14:52:45 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-06-18 14:52:45 +0300
commit6b6e82f8e9c11aeecbd47038a0c637ff5c8f8a1f (patch)
treeba7df2a743dbfc86790451977e37295723858522 /rpm2cpio.c
parent4abfb4c186e1c3ad72c0899048d306a35a43fe8c (diff)
downloadrpm-6b6e82f8e9c11aeecbd47038a0c637ff5c8f8a1f.tar.gz
rpm-6b6e82f8e9c11aeecbd47038a0c637ff5c8f8a1f.tar.bz2
rpm-6b6e82f8e9c11aeecbd47038a0c637ff5c8f8a1f.zip
Add -h/--help to rpm2cpio (ticket #63)
- patch originally from Debian, with slight adjustments to indentation
Diffstat (limited to 'rpm2cpio.c')
-rw-r--r--rpm2cpio.c7
1 files changed, 6 insertions, 1 deletions
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],