added "--help"/"-h" with basic info to wrudf
This commit is contained in:
parent
021bc443c7
commit
7e90784fe4
48
udftools-1.0.0b3-wrudf_help.patch
Normal file
48
udftools-1.0.0b3-wrudf_help.patch
Normal file
@ -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");
|
Loading…
Reference in New Issue
Block a user