# include "data.h"

int clear (int argc, char **argv) {
  
  int N, ClearSection;
  int Ngraph, Xgraph;

  Ngraph = -1;
  if ((N = get_argument (argc, argv, "-n"))) {
    remove_argument (N, &argc, argv);
    Ngraph = atof (argv[N]);
    remove_argument (N, &argc, argv);
  }
  if (!GetGraph (NULL, &Xgraph, &Ngraph)) return (FALSE);

  ClearSection = FALSE;
  if ((N = get_argument (argc, argv, "-s"))) {
    remove_argument (N, &argc, argv);
    ClearSection = TRUE;
  }

  if (argc != 1) {
    gprint (GP_ERR, "USAGE: clear [-n Xgraph]\n");
    return (FALSE);
  }

  KapaClear (Xgraph, ClearSection);
  return (TRUE);
}
