bin/dsktool.rb in dsktool-0.4.1 vs bin/dsktool.rb in dsktool-0.4.2
- old
+ new
@@ -18,11 +18,11 @@
# FILENAME should be compiled to run at $0801
# FILENAME can be up to 4Kb in size.
# -c | --catalog display catalog
# -d | --dump FILENAME hex dump
# -D | --diskdump hex dump of entire disk
-# --delete FILENAME (*) delete named file
+# -L | --delete FILENAME (*) delete named file
# -e | --extract FILENAME extract file by name (either to stdout,
# or file specified by --output)
# -h | --help display this message
# -I | --init FILESYSTEM initialise the disk with the specified filesytem
# DSK will be created if it doesn't exist.
@@ -61,11 +61,11 @@
# dsktool.rb --add c:\src\dosdemo\a.out -t B -b $2000 dosdemo.dsk
# dsktool.rb --init dos33 new_dos_disk.dsk.gz
# dsktool.rb --I none -B /tmp/a.out demo1.dsk
-DSKTOOL_VERSION="0.4.1"
+DSKTOOL_VERSION="0.4.2"
#make sure the relevant folder with our libraries is in the require path
lib_path=File.expand_path(File.dirname(__FILE__)+"//..//lib")
$:.unshift(lib_path) unless $:.include?(lib_path)
require 'rubygems'
@@ -112,11 +112,11 @@
opts.on("-a","--add FILENAME",String) {|val| add_filename=val}
opts.on("-I","--init FILESYSTEM",String) {|val| init_filesystem=val}
opts.on("-B","--bootcode FILENAME",String) {|val| boot_filename=val}
opts.on("-t","--filetype FILETYPE",String) {|val| add_file_options[:filetype]=val}
opts.on("-T","--tokenise") {add_file_options[:tokenise]=true}
-opts.on("-delete","--delete FILENAME",String) {|val| delete_filename=val}
+opts.on("-L","--delete FILENAME",String) {|val| delete_filename=val}
opts.on("-b","--base BASE",String) {|val| add_file_options[:base]=val}
filename=opts.parse(ARGV)[0] rescue RDoc::usage_from_file(__FILE__,'Usage')
RDoc::usage_from_file(__FILE__,'Usage') if (filename.nil?)
@@ -144,11 +144,10 @@
output_file= case
when (output_filename.nil?) || (explode) then STDOUT
else File.open(output_filename,"wb")
end
- puts "#{filename}\nsector order:\t#{dsk.sector_order}\nfilesystem:\t#{dsk.file_system}"
if (dsk.respond_to?(:volume_name)) then
puts "volume name:\t#{dsk.volume_name}"
end
if (diskdump) then
puts dsk.hex_dump
@@ -175,9 +174,11 @@
dsk.add_file(new_file)
dsk.save_as(filename)
end
if(catalog) then
+ puts "#{filename}\nsector order:\t#{dsk.sector_order}\nfilesystem:\t#{dsk.file_system}"
+
if (dsk.respond_to?(:dump_catalog)) then
puts dsk.dump_catalog
else
puts "#{filename} does not have a recognised file system"
end