Add -V option to test/iso.c little testing app.

This commit is contained in:
Vreixo Formoso Lopes 2007-09-06 15:15:09 +00:00
parent d60193e2d5
commit 5c82fc5108
1 changed files with 12 additions and 7 deletions

View File

@ -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 <num> 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 <num> 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 */