[unix] "squeak" startup script
Lex Spoon
lex at cc.gatech.edu
Tue Jul 27 15:16:52 UTC 2004
Okay, I spent some time the last couple of weeks thinking about how to
make typing "squeak" by itself do something sensible. This message
includes a copy of the resulting script, a copy of its man page, and the
rationale behind it all.
The main goal was that a new user can type "squeak" and get the expected
behavior. They should not get a lecture about the proper invocation.
They should not be given a lesson on image files and changes files.
They should jump right into the Squeak world and be ready to play with
the *cool* stuff, which is etoys, morphic, FM synthesis, and so on.
This turns out to be nice for experienced users, too, so the script
tries to accomodate them as well. Just because you know how to install
files manually from /usr/share/squeak doesn't mean you have to or want
to. But experienced users would like to be able to manage multiple
image files, would like to specify extra VM parameters, and even would
like to pass in arguments to their images.
Existing users are used to typing "squeak foo.image". I thought long
about this situation, but in the end, it is so simple to support, and it
is such a common thing to want, that I added a special case for it.
More complex command lines require the image to have an explicit -image
argument. For example:
squeak -memory 100m -image foo.image
I ended up rejecting four alternatives here:
1. The script could know how to parse every VM option, and thus
reliably pick out the image name. Since the options are irregular,
however, this is a lot of work. Further, the VM options are not fixed,
which means there is an arms race between the script and the VM.
2. The VM options other than the image could be preceded by "--". This
makes the command lines longer, however, and is especially bad if you
try to pass arguments to the image:
squeak foo.image -- -- arg1 arg2
Yuck! One "--" is bad enough, and two is terrible.
3. There could be a special option for VM arguments, e.g:
squeak -vm -memory,100m
This is my favorite approach conceptually, because it is unambiguously
parsable and because most users should not be entering VM arguments all
the time. However, in practice, I know I have typed "squeak -memory
100m" too many times to be happy with this. Plus, people who use Squeak
on machines without this script (assuming that such machines continue to
exist :)) will find it weird.
4. The VM arguments could be regularized, so that they may be detected
algorithmically. I like this approach a lot, but politically and
practically it seems difficult to make happen at this point.
It was a close call between these five options. If anyone has a strong
opinion I could certainly be swayed to change it.
A final consideration was that people would like to be able to pass
arguments to the squeak image. This is supported just like with the VM:
you can either put in an explicit "--", or you can just stick them at
the end of the command line if you think neither the script nor the VM
will not get confused by them.
Other notable little things:
1. -image can be used along with auto-installation. If you do "squeak
-image temp" then the script will install squeak into temp.image and
temp.changes if those files do not already exist. This is a tiny thing
I've *long* desired from inisqueak.
2. In addition to gzipped images, the script allows bzip2 and
uncompressed images. Also, the changes file is optional now; the script
will happily install and run a bare changes-less image file.
That's all. Comments welcome. If there are a lot of flying tomatoes
I'll change it all back in the next update.
Lex
------------- man page -----------------------
SQUEAK(1) SQUEAK(1)
NAME
squeak -- Squeak computer authoring system
SYNOPSIS
squeak [filename] [-install | -list | -l | -run ] [-image
file-
name]
[-verbose | -v ] [vm options] [-- image options]
DESCRIPTION
The squeak command starts Squeak, a computer authoring
system. No
arguments are necessary; typing squeak alone should
initialize any
files you need in the current directory and then start Squeak.
Squeak uses a few files in the current directory. The
file
squeak.image holds the objects representing the entire state
of your
world, including things such as open windows, a class hierarchy,
tex-
tual notes, prototype objects, and diagrams. The file
squeak.changes
holds a log of any program code you have written.
Finally,
SqueakV*.sources files are symbolic links to system-wide sources
files
holding program code that is common to all Squeak worlds.
OPTIONS
-install Run Squeak, but first initialize the present
directory if
there are files missing. If there is a choice of images to
install, then choose automatically. No files will be over-
written. This option gives the default behavior.
-l
-list Behave as if -install were specified, except that if an
image
file is to be installed, let the user choose from a list
which image to install.
-run Do not install any files. Either run Squeak, or fail.
-image filename
Instead of using squeak.image to save the state of the world,
use filename. Specifying the .image extension on filename is
optional. The name of the changes file to use will be deter-
mined automatically.
-v
-verbose Explain what files are being installed.
vm options
Any unrecognized options are passed directly to squeakvm.
-- image options
Any options following a double-hyphen are passed to the
Squeak world as it resumes. By convention, many worlds treat
the first such option as the name of a file to load and exe-
cute.
For convenience, an image may also be specified as the first
argument.
That is, the commandline squeak filename args is treated the
same as
squeak -run -image filename args.
ENVIRONMENT
SQUEAKVM The command to use for the virtual machine. The
default is
the first squeakvm in PATH.
SQUEAK_IMAGE_DIR
The directory holding available Squeak images to install.
The default is /usr/share/squeak.
SQUEAK_IMAGE
The filename of the image to run. The default is
squeak.image.
FILES
/usr/share/squeak/*.image
/usr/share/squeak/*.changes
Image and changes files that may be installed. They may also
be compressed with gzip(1) or bzip2(1), so long as an exten-
sion of .gz or .bz2 is added.
/usr/share/squeak/squeak.image
/usr/share/squeak/squeak.changes
The default image and changes files to install. Typically
these are symbolic links. If they are links to compressed
files, then they should have .gz or .bz2 exten-
sions matching the files they link to.
/usr/share/squeak/SqueakV?.sources
Source files.
SEE ALSO
squeakvm(1)
AUTHOR
This manual page was written by Lex Spoon (lex at debian.org).
Permission
is granted to copy, distribute and/or modify this document in any
way.
SQUEAK(1)
-----------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: squeak
Type: application/octet-stream
Size: 5059 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040727/ebf0e7aa/squeak.obj
More information about the Squeak-dev
mailing list
|