From e2c27e72f4ca185da79b6627c70dabd1825fdc61 Mon Sep 17 00:00:00 2001 From: ksherlock Date: Mon, 14 Dec 2009 03:59:39 +0000 Subject: [PATCH] git-svn-id: https://profuse.googlecode.com/svn/branches/v2@171 aa027e90-d47c-11dd-86d7-074df07e0730 --- pascal/profuse_pascal.cpp | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/pascal/profuse_pascal.cpp b/pascal/profuse_pascal.cpp index f24a95d..1aed2ac 100644 --- a/pascal/profuse_pascal.cpp +++ b/pascal/profuse_pascal.cpp @@ -33,12 +33,17 @@ void usage() std::printf("profuse_pascal 0.1\n\n"); std::printf( "usage:\n" - "profuse_pascal [-w] [-f format] [-o options] diskimage [mountpoint]\n" - " -w mount writable [not yet]\n" - " -f format specify the disk image format. Valid values are:\n" - " dc42 DiskCopy 4.2 Image\n" - " do DOS Order Disk Image\n" - " po ProDOS Order Disk Image (default)\n" + "profuse_pascal [options] diskimage [mountpoint]\n" + "Options:\n" + " -d debug\n" + " -r readonly\n" + " -w mount writable [not yet]\n" + " -v verbose\n" + " --format=format specify the disk image format. Valid values are:\n" + " dc42 DiskCopy 4.2 Image\n" + " do DOS Order Disk Image\n" + " po ProDOS Order Disk Image (default)\n" + " -o opt1,opt2... other mount parameters.\n" ); } @@ -74,7 +79,8 @@ static struct fuse_opt pascal_options[] = { PASCAL_OPT_KEY("-w", readWrite, 1), PASCAL_OPT_KEY("rw", readWrite, 1), - PASCAL_OPT_KEY("-f %s", format, 0), + PASCAL_OPT_KEY("--format=%s", format, 0), + PASCAL_OPT_KEY("format=%s", format, 0), {0, 0, 0} }; @@ -170,8 +176,12 @@ int main(int argc, char **argv) } // default prodos-order disk image. - format = ProFUSE::DiskImage::ImageType(options.format); - + if (options.format) + { + format = ProFUSE::DiskImage::ImageType(options.format); + if (!format) + std::fprintf(stderr, "Warning: Unknown image type ``%s''\n", options.format); + } if (!format) format = ProFUSE::DiskImage::ImageType(fDiskImage.c_str(), 'PO__'); @@ -234,6 +244,8 @@ int main(int argc, char **argv) } #endif + fuse_opt_add_arg(&args, "-ofsname=PascalFS"); + if (!options.readOnly) fuse_opt_add_arg(&args, "-ordonly");