Allow extraction to a file name for -e and -g

This commit is contained in:
2012-10-11 11:54:56 +00:00
parent b52df7745b
commit b53a6ba61c
2 changed files with 9 additions and 5 deletions

View File

@ -102,7 +102,7 @@ CreateDirectoryMenuItem=Create Directory...
CommandLineErrorMessage = Error: {0}
CommandLineNoMatchMessage = {0}: No match.
CommandLineStatus = {0} format; {1} bytes free; {2} bytes used.
CommandLineHelp = AppleCommander command line options [{0}]:\n-i <imagename> [<imagename>] display information about image(s).\n-ls <imagename> [<imagename>] list brief directory of image(s).\n-l <imagename> [<imagename>] list directory of image(s).\n-ll <imagename> [<imagename>] list detailed directory of image(s).\n-e <imagename> <filename> export file from image to stdout.\n-x <imagename> [<directory>] extract all files from image to directory.\n-g <imagename> <filename> get raw file from image to stdout.\n-p <imagename> <filename> <type> [[$|0x]<addr>] put stdin\n in filename on image, using file type and address [0x2000].\n-d <imagename> <filename> delete file from image.\n-k <imagename> <filename> lock file on image.\n-u <imagename> <filename> unlock file on image.\n-n <imagename> <volname> change volume name (ProDOS or Pascal).\n-cc65 <imagename> <filename> <type> put stdin with cc65 header\n in filename on image, using file type and address from header.\n-geos <imagename> interpret stdin as a GEOS conversion file and\n place it on image (ProDOS only).\n-dos140 <imagename> create a 140K DOS 3.3 image.\n-pro140 <imagename> <volname> create a 140K ProDOS image.\n-pro800 <imagename> <volname> create an 800K ProDOS image.\n-pas140 <imagename> <volname> create a 140K Pascal image.\n-pas800 <imagename> <volname> create an 800K Pascal image.\n-convert <filename> <imagename> [<sizeblocks>] uncompress a ShrinkIt or Binary\n II file; or convert a DiskCopy 4.2 image into a ProDOS disk image.
CommandLineHelp = CommandLineHelp = AppleCommander command line options [{0}]:\n-i <imagename> [<imagename>] display information about image(s).\n-ls <imagename> [<imagename>] list brief directory of image(s).\n-l <imagename> [<imagename>] list directory of image(s).\n-ll <imagename> [<imagename>] list detailed directory of image(s).\n-e <imagename> <filename> [<output>] export file from image to stdout\n or to an output file.\n-x <imagename> [<directory>] extract all files from image to directory.\n-g <imagename> <filename> [<output>] get raw file from image to stdout\n or to an output file.\n-p <imagename> <filename> <type> [[$|0x]<addr>] put stdin\n in filename on image, using file type and address [0x2000].\n-d <imagename> <filename> delete file from image.\n-k <imagename> <filename> lock file on image.\n-u <imagename> <filename> unlock file on image.\n-n <imagename> <volname> change volume name (ProDOS or Pascal).\n-cc65 <imagename> <filename> <type> put stdin with cc65 header\n in filename on image, using file type and address from header.\n-geos <imagename> interpret stdin as a GEOS conversion file and\n place it on image (ProDOS only).\n-dos140 <imagename> create a 140K DOS 3.3 image.\n-pro140 <imagename> <volname> create a 140K ProDOS image.\n-pro800 <imagename> <volname> create an 800K ProDOS image.\n-pas140 <imagename> <volname> create a 140K Pascal image.\n-pas800 <imagename> <volname> create an 800K Pascal image.\n-convert <filename> <imagename> [<sizeblocks>] uncompress a ShrinkIt or Binary\n II file; or convert a DiskCopy 4.2 image into a ProDOS disk image.
CommandLineSDKReadOnly = SDK, SHK, and DC42 files are read-only. Use the convert option on them first.
CommandLineDC42Bad = Unable to interpret this DiskCopy 42 image.

View File

@ -61,9 +61,11 @@ import com.webcodepro.applecommander.util.TextBundle;
* -ls &lt;imagename&gt; [&lt;imagename&gt;] list brief directory of image(s).
* -l &lt;imagename&gt; [&lt;imagename&gt;] list directory of image(s).
* -ll &lt;imagename&gt; [&lt;imagename&gt;] list detailed directory of image(s).
* -e &lt;imagename&gt; &lt;filename&gt; export file from image to stdout.
* -e &lt;imagename&gt; &lt;filename&gt; [&lt;output&gt;] export file from image to stdout
* or to an output file.
* -x &lt;imagename&gt; [&lt;directory&gt;] extract all files from image to directory.
* -g &lt;imagename&gt; &lt;filename&gt; get raw file from image to stdout.
* -g &lt;imagename&gt; &lt;filename&gt; [&lt;output&gt;] get raw file from image to stdout
* or to an output file.
* -p &lt;imagename&gt; &lt;filename&gt; &lt;type&gt; [[$|0x]&lt;addr&gt;] put stdin
* in filename on image, using file type and address [0x2000].
* -d &lt;imagename&gt; &lt;filename&gt; delete file from image.
@ -100,11 +102,13 @@ public class ac {
} else if ("-ll".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
showDirectory(args, FormattedDisk.FILE_DISPLAY_DETAIL);
} else if ("-e".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
getFile(args[1], args[2], true, System.out);
getFile(args[1], args[2], true,
(args.length > 3 ? new PrintStream(new FileOutputStream(args[3])) : System.out));
} else if ("-x".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
getFiles(args[1], (args.length > 2 ? args[2] : ""));
} else if ("-g".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
getFile(args[1], args[2], false, System.out);
getFile(args[1], args[2], false,
(args.length > 3 ? new PrintStream(new FileOutputStream(args[3])) : System.out));
} else if ("-p".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
putFile(args[1], new Name(args[2]), args[3],
(args.length > 4 ? args[4] : "0x2000"));