[comp.sys.amiga] Making Format a little nicer

higgin@cbmvax.UUCP (Paul Higginbottom) (06/27/89)

I became so irate the other day with the Format program's
requirement that I type in stupid words like NAME and DRIVE
that I wrote this little script and added the following aliases.

	Enjoy.

		Paul.

------------
File:  s:fmt
------------
.key drive/a,name/a,opt1,opt2,opt3,opt4
if <opt1> EQ "-e"
	echo "Format drive <drive>"
	echo "With Name <name>"
	echo "Options: <opt2> <opt3> <opt4>"
	sys:system/format drive <drive> name <name> <opt2> <opt3> <opt4>
else
	sys:system/format drive <drive> name <na> <opt1> <opt2> <opt3>
endif

------------
Add alias lines to s:Shell-Startup
------------
alias format execute s:fmt []
alias qformat execute s:fmt [] quick noicons

------------
To use:
------------
From the Shell, instead of typing the normal:
	format drive df0: name "foo"
you can enter:
	format df0: foo

And for quick formatting, instead of typing:
	format drive df0: name "foo" quick noicons
                                           ^[optional, granted]
you can enter:
	qformat df0: foo

Appending a "-e" option will echo the arguments to you before initiating
the format.  This is handy to make sure you're formatting the right
drive, etc.


Disclaimer: my opinions are own and not those of my employer.
[Pretty obvious since I'm badmouthing our own utility! :-)]

andy@cbmvax.UUCP (Andy Finkel) (06/27/89)

In article <7141@cbmvax.UUCP> higgin@cbmvax.UUCP (Paul Higginbottom) writes:
>I became so irate the other day with the Format program's
>requirement that I type in stupid words like NAME and DRIVE
>that I wrote this little script and added the following aliases.

Obviously, Format's slightly hard to use for a reason...so you have to
think about what you're typing, and so are less likely to zap an important
disk.  However, since we're all power users here, we can override it,
as you've shown.  

A few slight improvements on the script...

.key DRIVE/A,NAME,ECHO/S,FFS/S,NOICONS/S,QUICK/S
.bra {
.ket }
.def NAME noname
if "{echo}" NOT EQ ""
    echo "Format {drive}*NName is {name}*NOptions {ffs} {noicons} {quick}"
endif
format drive {drive} name {name} {ffs} {noicons} {quick}
; s:fmt
 



You could also make it loop, with a SKIP BACK for those times
when you need to format multiple disks.  They'd all have the same
name, unless you got a bit fancy, of course.

		andy
  
-- 
andy finkel		{uunet|rutgers|amiga}!cbmvax!andy
Commodore-Amiga, Inc.

  "It's in there."

Any expressed opinions are mine; but feel free to share.
I disclaim all responsibilities, all shapes, all sizes, all colors.

sparks@corpane.UUCP (John Sparks) (07/01/89)

In article <7144@cbmvax.UUCP> andy@cbmvax.UUCP (Andy Finkel) writes:
>In article <7141@cbmvax.UUCP> higgin@cbmvax.UUCP (Paul Higginbottom) writes:
>>I became so irate the other day with the Format program's
>>requirement that I type in stupid words like NAME and DRIVE
>>that I wrote this little script and added the following aliases.
>
>Obviously, Format's slightly hard to use for a reason...so you have to
>think about what you're typing, and so are less likely to zap an important
>disk.  However, since we're all power users here, we can override it,
>as you've shown.  
>

Y'know... If someone is ditzy enough to type "FORMAT DF1:" by mistake then they
are ditzy enough to type "FORMAT DRIVE DF1: NAME "Bujim" " by mistake. If the 
word FORMAT doesn't give it away, the words DRIVE and NAME sure won't.


Making someone type a few more words isn't going to stop stupidity. I think
format would be much better without the word DRIVE and NAME. The program should
be able to scan the command line for a device name ending with ':' and look for
and optional volume name in quotes for the name.

1> Format df0: "Bujim"

If you want to be safe, Format could print a message:

[beep]..This will erase all data on the disk in DF0: (or whatever device), Are
you sure you want to do this?


Just an opinion. Actually format is not used that often compared to other
commands so it's probably not too important to worry about.

-- 
John Sparks   |  {rutgers|uunet}!ukma!corpane!sparks | D.I.S.K. 24hrs 1200bps
|||||||||||||||          sparks@corpane.UUCP         | 502/968-5401 thru -5406  
Don't take life too seriously. You'll never get out of it alive.