Package org.jboss.forge.shell.command

Examples of org.jboss.forge.shell.command.OptionMetadata


         if (((candidates.size() == 1) && "".equals(candidates.get(0)))
                  || (state.isDuplicateBuffer() && state.isFinalTokenComplete()))
         {
            if (commandHolder.getState().getOption() != null)
            {
               OptionMetadata option = commandHolder.getState().getOption();
               reader.println();
               reader.println(option.getOptionDescriptor());
               if (candidates.size() == 1)
               {
                  reader.println();
                  reader.drawLine();
                  return true;
View Full Code Here


   public CommandParserContext parse(final CommandMetadata command, final Queue<String> tokens,
            final CommandParserContext ctx)
   {
      try
      {
         OptionMetadata option = command.getOrderedOptionByIndex(ctx.getOrderedParamCount());
         if (option.isVarargs())
         {
            List<String> args = new ArrayList<String>();
            String lastToken = null;
            // gobble unless we hit a named token
            while (!tokens.isEmpty())
View Full Code Here

   private static void processOption(final CommandParserContext ctx, final Queue<String> tokens,
            final CommandMetadata command, final String currentToken,
            final boolean shortOption)
   {
      OptionMetadata option = command.getNamedOption(currentToken);

      if (option.isBoolean())
      {
         String value = "true";
         if (!tokens.isEmpty())
         {
            if (!shortOption)
            {
               tokens.remove();
            }
            String nextToken = tokens.peek();
            if (!option.isFlagOnly() && (nextToken != null) && nextToken.matches("true|false"))
            {
               value = nextToken;
               tokens.remove();
            }
         }
View Full Code Here

         currentToken = currentToken.substring(2);
         if (command.hasOption(currentToken))
         {
            try
            {
               OptionMetadata option = command.getNamedOption(currentToken);
               if (option.isVarargs())
               {
                  tokens.remove();
                  List<String> args = new ArrayList<String>();
                  String rawValue = null;
                  // this has to be the last parameter... gobble the rest
View Full Code Here

         try
         {
            currentToken = currentToken.substring(2);
            if (command.hasOption(currentToken))
            {
               OptionMetadata option = command.getNamedOption(currentToken);

               if (!option.isBoolean() && !option.isVarargs())
               {
                  tokens.remove();
                  String value = null;
                  if (!tokens.isEmpty())
                  {
View Full Code Here

         }

         int numberOrderedParams = ctx.getOrderedParamCount();
         try
         {
            OptionMetadata option = command.getOrderedOptionByIndex(numberOrderedParams);
            if (!option.isVarargs())
            {
               ctx.put(option, Strings.stripQuotes(currentToken), Strings.stripQuotes(tokens.remove()));
               ctx.incrementParmCount();
            }
         }
View Full Code Here

TOP

Related Classes of org.jboss.forge.shell.command.OptionMetadata

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.