Wednesday, August 11, 2010

application now processes command line using Apache commons CLI

Entry point to application is now conf/DKApplication:

   private static final String VERSION_OPTION_KEY = "version";  
   private static final String HELP_OPTION_KEY = "help";  
   private static final String TEST_OPTION_KEY = "test";  
   private static final String PLAN_FILE_OPTION_KEY = "planfile";  
   private static final Options OPTIONS = new Options();  
   
   
   static {  
    OPTIONS.addOption(new Option(VERSION_OPTION_KEY,  
      "print the version information and exit"));  
    OPTIONS.addOption(new Option(HELP_OPTION_KEY, "print this message"));  
    OPTIONS.addOption(new Option(TEST_OPTION_KEY, "run embedded TestCase suite"));  
   }  
   
   
   public static void main(String[] args_) {  
    LOG.debug("args_->{}", Arrays.toString(args_));  
    try {  
      CommandLineParser parser = new PosixParser();  
      CommandLine line = parser.parse(OPTIONS, args_);  
      if (line.hasOption(VERSION_OPTION_KEY))  
       printVersion();  
      else if (line.hasOption(HELP_OPTION_KEY))  
       printHelp();  
      else if (line.hasOption(TEST_OPTION_KEY))  
       runTestCases();  
      else  
       printInvalidArguments(args_);  
   

commons CLI is very easy to use.

13 comments:

  1. Replies
    1. IEEE Final Year projects Project Centers in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes. IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble.Final Year Projects for CSE

      Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining .

      Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai

      The Angular Training covers a wide range of topics including Angular Directives, Angular Services, and Angular programmability.Angular Training

      Delete
  2. webs services & designs in affordable price for your Product to boost your Business.....

    ReplyDelete
  3. Tahukah anda langkah cara cepat menggugurkan kandungan untuk membantu mengatasi masalah kehamilan anda . Ada sebagian orang yang mempercayai asam jawa , kunyit asam , manjakani , jahe dan buah nanas muda , pepaya muda sebagai cara menggugurkan kandungan 100 berhasil dengan bahan alami . Meskipun beberapa makanan tersebut bisa menyebabkan keguguran . Tetapi itu hanya bereaksi jika kondisi kehamilan anda masih muda dan dalam kondisi lemah . Lantas , cara apa yang paling tepat untuk mengakhiri kehamilan dengan tuntas ? obat penggugur kandungan bisa anda jadikan solusi yang paling tepat dibandingkan cara tradisional tadi . Alat kelamin perempuan mempunyai bentuk yang berbeda-beda . Dan anatomi rahim wanita terkadang mengalami gangguan kewanitaan seperti keputihan . Bagaimana cara mengatasi keputihan yang biasa dialami pada perempuan . Dan salah satu masalah lagi yaitu mengalami kelonggaran organ intimnya , disini kami akan berbagi tips cara merapatkan miss v dengan cepat dan alami

    ReplyDelete
  4. Infycle Technologies, the No.1 software training institute in Chennai offers the best Oracle training in Chennai for students, freshers, and tech professionals. In addition to Oracle, other in-demand courses such as Data Science, Big Data, Java, AWS, Machine Learning, Python, Power BI, Digital Marketing will be trained with 200% practical classes. Once the completion of training, the trainees will be sent for placement interviews in the top MNC's. Call 7502633633 to get more info and a free demo.

    ReplyDelete