Modern Arguments to main()
P. D. Guthrie
pdg at ihdev.UUCP
Sat Mar 8 07:41:28 AEST 1986
I think that what the previous postings have been missing in the
discussion on command line arguments in icon-type environments is that
command line arguments are not really used to pass the input to the
program, rather set switches to control the execution, much as the /
switches in TOPS-20. To pass data gathered by pointing the mouse at
displayed text, etc, stdin should be used. Perhaps when selecting an
icon to execute with certain data, a distinctive method is used to bring
up a front end menu of command line arguments to be turned on or off (or
set) and when modified to satisfaction, the menu is closed and the
command executed. A front end could take a "usage description" for any
program from a file like this:
@/bin/cat "usvte"* FILE* #name, options and file, the * means 0 or more
u:SWITCH:Unbuffered:Buffered
s:SWITCH:Silent:Not Silent
v:SWITCH:Visible:Not Visible
t:SWITCH:Tabs:No Tabs
e:SWITCH:EOL indicate:No EOL indicate
So with this method, no changes to existing code would be needed, and
the option file(s) could even be used to produce from a non-iconic
shell. The front end simply changes the switches taken from the menu
into a shell line and executes the command. Does anyone know of a
system that uses this type of thing currently? The only icon based
shell that I have worked with is Sydix, and with that, when you define
an icon on your desktop, you say that it is a certain command with
arguments, so you would have to define something like :
1. a cat icon , no arguments,
2. a see icon, cat -v
I think the method I have listed above would be more versatile.
--
Paul Guthrie `When the going gets weird,
ihnp4!ihdev!pdg The weird turn pro'
- H. Thompson
More information about the Comp.lang.c
mailing list