/* (non-Javadoc)
   * @see com.buildml.main.ICliCommand#invoke(com.buildml.model.BuildStore, java.lang.String[])
   */
  @Override
  public void invoke(IBuildStore buildStore, String buildStorePath, String[] args) {

    CliUtils.validateArgs(
        getName(),
        args,
        2,
        2,
        "You must specify a package name and a colon-separated list of action-specs.");

    IPackageMemberMgr pkgMemberMgr = buildStore.getPackageMemberMgr();
    IActionMgr actionMgr = buildStore.getActionMgr();

    /*
     * The package can be of the form: "pkg". There is no scope value allowed
     * for actions.
     */
    String pkgName = args[0];
    int pkgAndScopeIds[] = CliUtils.parsePackageAndScope(buildStore, pkgName, false);
    int pkgId = pkgAndScopeIds[0];

    /* compute the ActionSet from the user-supplied list of action-specs */
    String actionSpecs = args[1];
    ActionSet actionsToSet = CliUtils.getCmdLineActionSet(actionMgr, actionSpecs);

    /* now visit each action in the ActionSet and set its package */
    boolean prevState = buildStore.setFastAccessMode(true);
    for (int actionId : actionsToSet) {
      pkgMemberMgr.setPackageOfMember(IPackageMemberMgr.TYPE_ACTION, actionId, pkgId);
    }
    buildStore.setFastAccessMode(prevState);
  }
 /* (non-Javadoc)
  * @see com.buildml.main.ICliCommand#getLongDescription()
  */
 @Override
 public String getLongDescription() {
   return CliUtils.genLocalizedMessage("#include commands/set-action-pkg.txt");
 }