You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-full-overlay/sys-fs/udftools/files/udftools-1.0.0b3-wrudf_help...

53 lines
1.2 KiB

taken from Fedora
http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-wrudf_help.patch?h=f22
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");