package commons.cmd;
import commons.application.core.Command;
public class ren extends Command
{

private static final String MUSTHAVE = "old,new";
private static final String ARGS     = "ARGS: old:<oldname> new:<newname>. ";

public void process () throws Exception
{
   String oldname = ctx.consume("old", "");
   String newname = ctx.consume("new", "");
   // Manager.ui().put("Renaming " + oldname + " -> " + newname);
   ctx.rename(oldname, newname);
}

public void signContract ()
{
   super.demand(MUSTHAVE, null);
}

public String description ()
{
   return implName() + " renames a key in the context (move a value to other key): " + ARGS;
}
}
