From 7e90784fe4f8cee0b0fffa79a86a29bf7a0d9859 Mon Sep 17 00:00:00 2001 From: Frantisek Kluknavsky Date: Mon, 15 Apr 2013 16:30:26 +0200 Subject: [PATCH] added "--help"/"-h" with basic info to wrudf --- udftools-1.0.0b3-wrudf_help.patch | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 udftools-1.0.0b3-wrudf_help.patch diff --git a/udftools-1.0.0b3-wrudf_help.patch b/udftools-1.0.0b3-wrudf_help.patch new file mode 100644 index 0000000..40e0ec9 --- /dev/null +++ b/udftools-1.0.0b3-wrudf_help.patch @@ -0,0 +1,48 @@ +diff -up wrk/wrudf/wrudf.c.wrk wrk/wrudf/wrudf.c +--- wrk/wrudf/wrudf.c.wrk 2013-04-15 15:32:03.395528452 +0200 ++++ wrk/wrudf/wrudf.c 2013-04-15 16:06:37.535546730 +0200 +@@ -603,6 +603,28 @@ parseCmnd(char* line) + return cmnd; + } + ++int show_help() ++{ ++ char *msg = ++ "Interactive tool to maintain an UDF filesystem.\n" ++ "Usage:\n" ++ "\twrudf [device]\n" ++ "Available commands:\n" ++ "\tcp\n" ++ "\trm\n" ++ "\tmkdir\n" ++ "\trmdir\n" ++ "\tlsc\n" ++ "\tlsh\n" ++ "\tcdc\n" ++ "\tcdh\n" ++ "Specify cdh/lsh or cdc/lsc to do cd or ls for Harddisk or CompactDisc.\n" ++ "\tquit\n" ++ "\texit\n"; ++ printf("%s", msg); ++ return 0; ++} ++ + int + main(int argc, char** argv) + { +@@ -614,8 +636,14 @@ main(int argc, char** argv) + printf("wrudf " WRUDF_VERSION "\n"); + devicename= "/dev/cdrom"; + +- if(argc > 1 ) ++ if(argc > 1 ) { ++ if (strcmp(argv[1], "-h")==0 || strcmp(argv[1], "-help")==0 || strcmp(argv[1], "--help")==0) { ++ return show_help(); ++ } ++ } ++ else { + devicename = argv[1]; /* can specify disk image filename */ ++ } + + if( setpriority(PRIO_PROCESS, 0, -10) ) { + printf("setpriority(): %m\n");