package examples.dustin.commandline.jbock;

import static java.lang.System.out;

import net.jbock.CommandLineArguments;
import net.jbock.Parameter;

import java.util.Optional;

/**
 * Demonstrates use of jbock to process command-line
 * arguments in a Java application.
 */
public class Main
{

   @CommandLineArguments
   abstract static class Arguments
   {

      /**
       * Verbosity enabled?
       */
      @Parameter(shortName = 'v', longName = "verbose")
      abstract boolean verbose();

      /**
       * File name and path
       */
      @Parameter(shortName = 'f', longName = "file")
      abstract String file();
   }

   public static void main(String[] arguments)
   {
      Arguments args = Main_Arguments_Parser.create().parseOrExit(arguments);
      System.out.println("The file '" + args.file() + "' was provided and verbosity is set to '" + args.verbose() + "'.");
   }
}

@@ -41,45 +41,8 @@
 k;%0A%0A
-import static java.lang.System.out;%0A%0A
 impo
@@ -61,29 +61,16 @@
 .Command
-LineArguments
 ;%0Aimport
@@ -84,45 +84,14 @@
 ock.
-Parameter;%0A%0Aimport java.util.
 Option
-al
 ;%0A%0A/
@@ -122,16 +122,20 @@
 f jbock 
+3.4 
 to proce
@@ -226,21 +226,8 @@
 mand
-LineArguments
 %0A   
@@ -323,55 +323,48 @@
    @
-Parameter(shortName = 'v', longName = %22verbose%22
+Option(value = %22verbose%22, mnemonic = 'v'
 )%0A  
@@ -455,52 +455,45 @@
    @
-Parameter(shortName = 'f', longName = %22file%22
+Option(value = %22file%22, mnemonic = 'f'
 )%0A  

update jbock example