From 5c82fc5108b42b3622e6c9a5bba7c187ffd7510c Mon Sep 17 00:00:00 2001 From: Vreixo Formoso Lopes Date: Thu, 6 Sep 2007 15:15:09 +0000 Subject: [PATCH] Add -V option to test/iso.c little testing app. --- test/iso.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/test/iso.c b/test/iso.c index fba9d6b..dc9cea9 100644 --- a/test/iso.c +++ b/test/iso.c @@ -20,7 +20,7 @@ #define SECSIZE 2048 -const char * const optstring = "JRL:b:h"; +const char * const optstring = "JRL:b:hV:"; extern char *optarg; extern int optind; @@ -33,11 +33,12 @@ void help() { printf( "Options:\n" -" -J Add Joliet support\n" -" -R Add Rock Ridge support\n" -" -L Set the ISO level (1 or 2)\n" -" -b file Specifies a boot image to add to image\n" -" -h Print this message\n" +" -J Add Joliet support\n" +" -R Add Rock Ridge support\n" +" -V label Volume Label\n" +" -L Set the ISO level (1 or 2)\n" +" -b file Specifies a boot image to add to image\n" +" -h Print this message\n" ); } @@ -55,6 +56,7 @@ int main(int argc, char **argv) struct iso_tree_radd_dir_behavior behav = {0,0,0}; int level=1, flags=0; char *boot_img = NULL; + char *volid = "VOLID"; while ((c = getopt(argc, argv, optstring)) != -1) { switch(c) { @@ -75,6 +77,9 @@ int main(int argc, char **argv) case 'b': boot_img = optarg; break; + case 'V': + volid = optarg; + break; case '?': usage(); exit(1); @@ -108,7 +113,7 @@ int main(int argc, char **argv) if (!root) { err(1, "error opening input directory"); } - volume = iso_volume_new_with_root( "VOLID", "PUBID", "PREPID", root ); + volume = iso_volume_new_with_root(volid, "PUBID", "PREPID", root); if ( boot_img ) { /* adds El-Torito boot info. Tunned for isolinux */