[Scummvm-devel] CLI frontend for the tools.

Thierry Crozat (Yahoo! Mail) thierry.crozat at yahoo.co.uk
Tue May 12 01:32:50 CEST 2009


Hello,
I am throwing some thoughts as a reply to your mail before going to  
bed. I hope they make sense.

Unifying the command line arguments seems a good idea to me. For  
example the fact that we can specify the output directory for some of  
the compress tools (e.g. compress_kyra, compress_scumm_bun) but not  
others (e.g. compress_sword1, compress_sword2) seems strange and a  
potential source of errors.

As for the way to specify the outut file or directory, I am not sure  
the -o option is a good idea. Usually I expect it if it is optional,  
e.g. if the command by default output the result to std out. If the  
destination is compulsory then I usually expect to have it as the  
last argument without a flag (e.g. the cp command):
    extract [extra params] [--tools tool-to-use] inputfiles... outputdir
But even if it is optional, it is sometime the last argument without  
a flag (e.g. the link name in the ln command). However I don't really  
like it. If there is a default (and the output file/dir is therefore  
optional) I think it would indeed be logical to use a flag (by the  
way I am not sure if I would expect the default to be ./ or same as  
input directory in the case of a output directory).

Using -o for output files is quite common, so it is the obvious  
candidate for output files, and then it should be possible to have it  
before the input files on the command line:
   extract [extra params] [--tools tool-to-use] [-o outputfile]  
inputfiles...
I would be less incline to use -o to specify an output directory. It  
seems strange to me. The first flag that comes to my mind for that is  
-d but I am not too sure why (maybe because destination and directory  
both start with a d). unzip uses this flag, but right now I don't  
remember any other command that do.

Sorry. It seems I am asking more questions than giving answers ;-)

Thierry

Le 11 mai 09 à 23:30, Remere a écrit :

> Hello, as you might recall, I'm one of the GSoC students. But I've  
> been quite busy lately, but now I thought to gather input on how to  
> actually realize it.
> What I'm curious is the style of the CLI arguments to the program,  
> as unifying them will mean cleaner code for the tools, and make it  
> easier for the people who prefer the terminal to use.
> You can find how all the individual tools now work here (ie. CLI  
> style): http://scummvm.svn.sourceforge.net/viewvc/scummvm/tools/ 
> trunk/README?revision=35144
> For the extraction tools, the format of input parameters is quite  
> well defined, however, I propose that output should be controlled  
> by a '-o' parameter, which is a directory (or filename, depending  
> on the tool) to output to, which would default to './' (currernt  
> directory, if the output is a single file, default name is based on  
> the tool used). A special --tool parameter is supplied to select  
> the correct format if it cannot be decided by heuristic (perhaps  
> the tool should also ask for input then also?). So the format becomes:
>   extract [extra params] [--tool tool-to-use] inputfiles.... [-o  
> outputfile]
> For the compression tools the format is slightly more complex,  
> mainly because alot of tools expect specific parameters, also:
>   compress [extra-params] [--tool tool-to-use] [tool-specific- 
> params] inputfiles [-o outputfile/dir]
> extra-params is generally compression specifics such as bitrate.  
> Perhaps I'll also write better documentation of this.
> Opinions are most welcome, I probably haven't covered all angles  
> here, and maybe another argument style is preferred?.
> Joakim
> ---------------------------------------------------------------------- 
> --------
> The NEW KODAK i700 Series Scanners deliver under ANY circumstances!  
> Your
> production scanning environment may not be a perfect world - but  
> thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW  
> KODAK i700
> Series Scanner you'll get full speed at 300 dpi even with all image
> processing features enabled. http://p.sf.net/sfu/kodak- 
> com_______________________________________________
> Scummvm-devel mailing list
> Scummvm-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/scummvm-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scummvm.org/pipermail/scummvm-devel/attachments/20090512/162699b1/attachment.html>


More information about the Scummvm-devel mailing list