package nxm.sys.intr;

import nxm.sys.lib.Args;
import nxm.sys.lib.Intrinsic;
import nxm.sys.lib.Shell;

/**
  Parse a command from the dictionary.

  @author Jeff Schoen

*/
public class Parse extends Intrinsic {

  String cmd,label;
  Args targs;

  /** default constructor */
  public Parse () {}

  public int process() {

    cmd = MA.getU("CMD");
    targs = Shell.parseCommand(M,cmd);

    label = MA.getU("NAME");
    MR.put(label, targs.name);

    label = MA.getU("SUP");
    MR.put(label, ""+targs.support);

    label = MA.getU("OPT");
    MR.put(label, targs.option);

    return (FINISH);
  }
}

