Examples of CommandMetaData


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

      for (CharSequence seq : candidates)
      {
         boolean processed = false;
         if (commandHolder.getState() != null)
         {
            CommandMetadata command = commandHolder.getState().getCommand();
            if ((command != null) && seq.toString().startsWith("--"))
            {
               String str = seq.toString().trim();
               if (str.startsWith("--"))
               {
                  str = str.substring(2);
               }

               if (command.hasOption(str) && command.getNamedOption(str).isRequired())
               {
                  seq = shell.renderColor(ShellColor.BLUE, seq.toString());
                  colorizedCandidates.add(seq);
                  processed = true;
               }
View Full Code Here

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

public class DeprecatedObserver
{

   public void beforeCommandExecution(@Observes PreCommandExecution cmd, Shell shell)
   {
      CommandMetadata command = cmd.getCommand();
      boolean deprecated = command.getMethod().isAnnotationPresent(Deprecated.class);
      if (deprecated)
      {
         String message = String.format("The command (%s) is deprecated and may be removed in future versions",
                  command.getName());
         ShellMessages.warn(shell, message);
      }
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.