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.

8 comments:

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

    ReplyDelete
  2. The TronLink offers a simple-to-use interface incorporated with highly responsive client service, making the wallet perfect for new cryptocurrency investors.

    TronLink Wallet

    ReplyDelete
  3. Koala wallet is a great option for your digital wallet needs, whether you want to trade cryptocurrencies, keep your assets safely, or just learn more about the world of cryptocurrency.
    Koala Wallet

    ReplyDelete
  4. Bio Valley is a brand renowned for its commitment to delivering high-quality skincare, hair care, and wellness products. Known for its dedication to natural and organic formulations, Bio Valley combines the essence of nature with modern science to create products that cater to diverse needs.

    Key Highlights of Bio Valley:
    Wide Range of Products: From body washes and shampoos to specialized skincare solutions, Bio Valley offers a versatile range tailored to enhance beauty and wellness.
    Natural Ingredients: The brand emphasizes using eco-friendly, plant-based ingredients, ensuring that its products are gentle on the skin and hair while being environmentally sustainable.
    Targeted Solutions: Bio Valley products are designed to address specific concerns, such as dry skin, oily hair, or sensitive scalps, making them suitable for a wide audience.
    Ethical Practices: The company upholds sustainable and cruelty-free practices, reflecting its commitment to environmental responsibility.
    Holistic Approach: With a focus on wellness, Bio Valley promotes not just outer beauty but also overall health, aligning with holistic lifestyle trends.

    ReplyDelete