package commons.cmd;
import commons.application.GLOBAL;
import commons.application.Application;
import commons.application.core.Command;
import commons.utl.CtxUtl;
public class echo extends Command
{

private static final String ARGS = "ARGS: [<output>]. ";

public void process () throws Exception
{
   String cmd = ctx.consume(GLOBAL.CTX_ENVKEY_ARG0, "");
   // TaggedTokenReplacer ttr = new TaggedTokenReplacer(cmd);
   // for (Iterator<String> tokens = ttr.getAllTokens(); tokens.hasNext(); ) {
   // String t = (String) tokens.next();
   // Object obj = ctx.get(t, (Object)null);
   // ttr.replace(t, obj==null?"":obj.toString());
   // }
   Application.ui().print(GLOBAL.VAL_PREFIX_INFO + CtxUtl.resolveVariables(ctx, cmd));
}

public void signContract ()
{}

public String description ()
{
   return implName() + " print the input argument. May contain context variables which must be masked like this: value of x is %x%. "
      + ARGS;
}
}
