# include "imregister.h"
# include "spreg.h"

int args (int argc, char **argv) {

  int N;

  ConfigInit (&argc, argv); /* load elixir config data */

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

  output.verbose = FALSE;
  if (N = get_argument (argc, argv, "-v")) {
    remove_argument (N, &argc, argv);
    output.verbose = TRUE;
  }

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

  /* all imregister programs are implicitly modifying the db */
  output.modify = TRUE;
  IMSORT = FALSE;

  if (strstr (argv[0], "spregister") != (char *) NULL) {
    if (argc != 2) {
      fprintf (stderr, "ERROR: Usage: spregister (filename) [-noreg]\n");
      exit (1);
    }
    return (TRUE);
  }
  if (strstr (argv[0], "showspinfo") != (char *) NULL) {
    if (argc != 2) {
      fprintf (stderr, "ERROR: Usage: showspinfo (filename)\n");
      exit (1);
    }
    return (TRUE);
  }
  return (FALSE);
}
