j-woz / exm-issues

Automatically exported from code.google.com/p/exm-issues
0 stars 0 forks source link

Move command line option handling to Java #444

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
A lot of logic has ended up in the ./bin/stc wrapper script to do with command 
line argument handling.  This makes it a headache to add new command line 
options since we have to handle them in the script, and then add a way to pass 
the info into the Java program. 

Let's switch to doing all argument handling in Java for consistency and so that 
all logic can be encapsulated inthe sample place.

Original issue reported on code.google.com by tim.g.ar...@gmail.com on 14 Mar 2013 at 8:54

GoogleCodeExporter commented 9 years ago
In the current model, the shell script handles unix stuff like environment 
variables and the standard getopts processing, and anything else involving the 
OS, etc. .  It also manages the call to CPP and other things that the Java 
stuff is not involved in.  Then, all arguments are passed to java using Java 
properties of the form stc.x.y.z=value, and all of these are processed by 
Settings.java .  Thus, any setting in STC can easily be tracked down, and the 
STC Java code does not need to parse a command line or use getenv().  

I like the current model. 

Original comment by wozniak....@gmail.com on 18 Mar 2013 at 2:40

GoogleCodeExporter commented 9 years ago
It's a headache to work with though: it's not easy to launch STC in a debugger 
with specific command line options without going through the code and looking 
at environment variable names.  Any new options have to be added in multiple 
places.  We can't really provide good error reporting for command line switches 
unless we duplicate validation clo.  The argument order is also semi-broken - 
you can't have command line switches after the input or output files.

Argument processing in Java is easy enough - there are good libraries - I don't 
think that we gain much by avoiding that.

Original comment by tim.g.ar...@gmail.com on 18 Mar 2013 at 6:08

GoogleCodeExporter commented 9 years ago
This isn't high priority, but it is a fairly frequent source of mild 
inconvenience for me.

Original comment by tim.g.ar...@gmail.com on 18 Mar 2013 at 6:14

GoogleCodeExporter commented 9 years ago

Original comment by tim.g.ar...@gmail.com on 13 Jun 2014 at 2:05