diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2022-03-07 14:43:44 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2022-03-07 14:43:44 +0100 |
commit | cbcab8684e06379c9f5c51cfc9cac68d8684fe0c (patch) | |
tree | d03b04e9a7f8e3aae70e590953408f90deed077c /old/skeletons/java.erb | |
parent | 721a7ea65d23e7b149ba73968a1d75727a55b390 (diff) | |
download | vim-cbcab8684e06379c9f5c51cfc9cac68d8684fe0c.zip vim-cbcab8684e06379c9f5c51cfc9cac68d8684fe0c.tar.gz |
move to old
Diffstat (limited to 'old/skeletons/java.erb')
-rw-r--r-- | old/skeletons/java.erb | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/old/skeletons/java.erb b/old/skeletons/java.erb new file mode 100644 index 0000000..f0ec54a --- /dev/null +++ b/old/skeletons/java.erb @@ -0,0 +1,66 @@ +/* vim: set expandtab tabstop=4 shiftwidth=4 : */ + +// package pkgname; + +import java.io.File; +import java.util.Date; +import jargs.gnu.CmdLineParser; + +/** + * Class <%= @class_name %> + * + * @author <% @username %> <<%= @email %>> + * @date <%= @now %> + */ +public class <%= @class_name %> { + + /* + * print usage and exit with status 1 + */ + private static void printUsage() + { + System.err.println("Usage : <%= @class_name %> [{-d, --debug} a_float] [ --input file_name]"); + System.err.println(" debug : debug verbosity"); + System.err.println(" input : path to input file"); + } + + /** + * application entry point + */ + public static void main(String [] args ) + { + + CmdLineParser parser = new CmdLineParser(); + CmdLineParser.Option debug = parser.addIntegerOption('d',"debug"); + CmdLineParser.Option input = parser.addStringOption("input"); + + try { + parser.parse(args); + } catch (CmdLineParser.OptionException e) { + System.err.println("\n"+e.getMessage()); + printUsage(); + System.exit(2); + } + + int debugLevel = ((Integer)parser.getOptionValue(debug,new Integer(0))).intValue(); + String inputFile = (String)parser.getOptionValue(input); + + if (debugLevel>0) { + System.out.println("Debug Trace :"); + System.out.println("\t"+new Date( ) ); + System.out.println("\tdebug level : "+debugLevel); + System.out.println("\texcel file : "+inputFile); + } + + if (inputFile!=null && !inputFile.equals("")) { + File f = new File(inputFile); + if(!f.canRead()){ + System.err.println("Fatal Error : Unable to read "+inputFile); + System.exit(1); + } + } + + System.exit(0); + } +} + |