What would wickel do ?

Imagine, you want to use 'enscript' to produce PostScript output for some files. And you want that output to be set in two columns as landscape with the heading "This is my printout" in Helvetica on the printer "local-printer", suppressing a burst-page.

Wouldn't it be nice if one could pop up a GUI, fill in the relevant fields and either send the resulting command to the clipboard or run it directly ?

Clearly, writing a GUI from scratch for every CLI program that it might be useful for is very tedious and won't get very far. Hence the need for a tool that uses a high-level description of a command to produce the GUI.

The reason why it is possible to automatically generate the GUI is that the semantics of the GUI will be extremely simple: accept some values and assemble them into one string which can be run on the command line. Note that tools like find are way out of reach for this approach, since find's command line switches are effectively a small language and should be dealt with differently. But the vast majority of UNIX tools adheres to a very simple semantic model: a command is parametrized by certain variables, whose values can be set either through switches or environment variables. Since the command line is only used for passing individual, independent values, it is very easy to capture a command line with an automatically generated GUI.

To make the generated GUI a helpful tool, it has to perform error-checks on the values the user inputs. Many of these checks can be automated: once it has been indicated that a certain argument is an output file, wickel can automatically output checks to ensure that a file isn't overwritten by mistake. The checks that can not be automated have to be coded by hand and included in the GUI. At this point it becomes important, that the GUI description language makes it easy to add user-code; at the very least, the GUI has to expose all the values entered for switches so far to the user-code.

Why would one want to do this ?

The way it does this is by using a formalized description of the options a command takes, e.g.

	(switch switch1 r "Landscape") 
      
declares that switch1 corresponds to the option "-r". This declaration will produce a toggle button labeled "Landscape" in the GUI
	(switch switch2 header b string "Custom header:")
      
declares that switch2 corresponds to the option "-bSTRING" where STRING will be read from an entry-field in the GUI labeled "Custom header:"

On top of the description and type-declaration of the switches, one also needs a very high-level description of the layout that arranges all the elements defined with a 'switch' statement into pages in a notebook.

Some issues/enhancements:

A complete implementation of wickel should at least contain the features listed below. I am very interested to hear more suggestions for enhancements. Please mail them to me.

Notes on the current implementation: