code: @Override
      protected void doHandle(CommandContext ctx) throws CommandLineException {
          ParsedCommandLine parsedArgs = ctx.getParsedCommandLine();
          final List<String> vars = parsedArgs.getOtherProperties();
          if(vars.isEmpty()) {
              final Collection<String> defined = ctx.getVariables();
              if(defined.isEmpty()) {
                  return;
              }
              final List<String> pairs = new ArrayList<String>(defined.size());
              for(String var : defined) {
                  pairs.add(var + '=' + ctx.getVariable(var));
              }
              Collections.sort(pairs);
              for(String pair : pairs) {
                  ctx.printLine(pair);
              }
              return;
          }
          for(String arg : vars) {
              arg = ArgumentWithValue.resolveValue(arg);
              if(arg.charAt(0) == '$') {
                  arg = arg.substring(1);
                  if(arg.isEmpty()) {
                      throw new CommandFormatException("Variable name is missing after '$'");
                  }
              }
              final int equals = arg.indexOf('=');
              if(equals < 1) {
                  throw new CommandFormatException("'=' is missing for variable '" + arg + "'");
              }
              final String name = arg.substring(0, equals);
              if(name.isEmpty()) {
                  throw new CommandFormatException("The name is missing in '" + arg + "'");
              }
              if(equals == arg.length() - 1) {
                  ctx.setVariable(name, null);
              } else {
                  String value = arg.substring(equals + 1);
                  if(value.length() > 2 && value.charAt(0) == '`' && value.charAt(value.length() - 1) == '`') {
                      value = Util.getResult(ctx, value.substring(1, value.length() - 1));
                  }
                  ctx.setVariable(name, value);
              }
          }
      }
docs: /* (non-Javadoc)
  @see org.jboss.as.cli.handlers.CommandHandlerWithHelp#doHandle(org.jboss.as.cli.CommandContext)