diff --git a/pascal/FileMan.cpp b/pascal/FileMan.cpp index 47f0afe..5bfec89 100644 --- a/pascal/FileMan.cpp +++ b/pascal/FileMan.cpp @@ -10,6 +10,8 @@ #include #include +#include + #include "File.h" #include "DateRec.h" #include "../BlockDevice.h" @@ -142,11 +144,46 @@ void list(Pascal::VolumeEntry *volume, bool extended) } +void usage() +{ + std::printf( + "Pascal File Manager v 0.0\n\n" + "Usage: fileman [-h] [-f format] action diskimage\n" + "Options:\n" + " -h Show usage information.\n" + " -f format Specify disk format. Valid values are:\n" + " po: ProDOS order disk image\n" + " do: DOS Order disk image\n" + "\n" + "Actions:\n" + " L List files\n" + " E List files (extended)\n" + ); + +} + int main(int argc, char **argv) { std::auto_ptr volume; std::auto_ptr device; + std::string format; + + while ((int c = ::getopt(argc, argv, "f:h")) != -1) + { + switch(c) + { + case 'f': + format = optarg; + break; + + case 'h': + case '?': + usage(); + exit(); + } + } + const char *file = argv[1];