<commit_before># include <stdio.h>
# include <stdlib.h>
# include <string.h>

# include "acs.h"
# include "acserr.h"

/* CALACS driver: retrieves input table name and calls pipeline
*/

int	status;		/* value of zero indicates OK */

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

	/* Local variables */
	char input[ACS_FNAME+1];
	int printtime = NO;	/* print time after each step? */
	int save_tmp = DUMMY;	/* save temporary files? */
	int verbose = NO;	/* print info during processing? */
	int debug = NO;		/* print debug statements during processing? */
	int quiet = NO;		/* suppress STDOUT messages? */
	int too_many = NO;	/* too many command-line arguments? */
	int i, j;		/* loop indexes */

	/* Function definitions */
	void c_irafinit (int, char **);
	int CalAcsRun (char *, int, int, int, int);
    void WhichError (int);
    
	/* Initialize status to OK and MsgText to null */
	status = ACS_OK;
	MsgText[0] = '\0';
	input[0] = '\0';

	/* Initialize IRAF environment */
	c_irafinit(argc, argv);

	/* Command line arguments: 
	**         1. input file name
	**		   2. print time?
	**		   3. save intermediate files?
	**		   4. verbose?
	*/
	for (i = 1;  i < argc;  i++) {
		if (argv[i][0] == '-') {
		  for (j = 1;  argv[i][j] != '\0';  j++) {
		    if (argv[i][j] == 't') {
				printtime = YES;
		    } else if (argv[i][j] == 's') {
				save_tmp = YES;
		    } else if (argv[i][j] == 'v') {
				verbose = YES;
		    } else if (argv[i][j] == 'd') {
				debug = YES;
		    } else if (argv[i][j] == 'q') {
				quiet = YES;
		    } else {
				printf ("Unrecognized option %s\n", argv[i]);
				exit (ERROR_RETURN);
		    }
		  }
	    } else if (input[0] == '\0') {
		strcpy (input, argv[i]);
	    } else {
		too_many = YES;
	    }
	}
	
	if (input[0] == '\0' || too_many) {
	    printf ("syntax:  calacs.e [-t] [-s] [-v] [-q] input \n");
	    exit (ERROR_RETURN);
	}

	/* Initialize the structure for managing trailer file comments */
	InitTrlBuf ();

	/* Copy command-line value for QUIET to structure */
	SetTrlQuietMode(quiet);
	
	/* Call the CALACS main program */
	if (CalAcsRun (input, printtime, save_tmp, verbose, debug)) {

        if (status == NOTHING_TO_DO){
            /* If there is just nothing to do, 
                as for ACQ images, just quit...     WJH 27Apr1999 */
            status = 0;
	        sprintf (MsgText, "CALACS did NOT process %s", input);
	        trlmessage (MsgText);
            exit(0); 
        } else {
	        /* Error during processing */
	        sprintf (MsgText, "CALACS processing NOT completed for %s", input);
		    trlerror (MsgText);
            /* Added 19 Mar 1999 - provides interpretation of error for user */
            WhichError (status);
		    CloseTrlBuf ();
	        exit (ERROR_RETURN);
        }
	}

	/* Successful completion */
	sprintf (MsgText, "CALACS completion for %s", input);
	trlmessage (MsgText);

	CloseTrlBuf ();
	
	/* Exit the program */
	exit (0);
}<commit_msg>Added --version options to hstcal calacs.<commit_after># include <stdio.h>
# include <stdlib.h>
# include <string.h>

# include "acs.h"
# include "acserr.h"
# include "acsversion.h"

/* CALACS driver: retrieves input table name and calls pipeline
*/

int	status;		/* value of zero indicates OK */

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

	/* Local variables */
	char input[ACS_FNAME+1];
	int printtime = NO;	/* print time after each step? */
	int save_tmp = DUMMY;	/* save temporary files? */
	int verbose = NO;	/* print info during processing? */
	int debug = NO;		/* print debug statements during processing? */
	int quiet = NO;		/* suppress STDOUT messages? */
	int too_many = NO;	/* too many command-line arguments? */
	int i, j;		/* loop indexes */

	/* Function definitions */
	void c_irafinit (int, char **);
	int CalAcsRun (char *, int, int, int, int);
    void WhichError (int);
    
	/* Initialize status to OK and MsgText to null */
	status = ACS_OK;
	MsgText[0] = '\0';
	input[0] = '\0';

	/* Initialize IRAF environment */
	c_irafinit(argc, argv);

	/* Command line arguments: 
	**       0. Check for --version option
  **
  **       1. input file name
	**		   2. print time?
	**		   3. save intermediate files?
	**		   4. verbose?
	*/
	for (i = 1;  i < argc;  i++) {
    if (!(strcmp(argv[i],"--version"))) {
      printf("%s\n",ACS_CAL_VER_NUM);
      exit(0);
    }
    
		if (argv[i][0] == '-') {
		  for (j = 1;  argv[i][j] != '\0';  j++) {
		    if (argv[i][j] == 't') {
          printtime = YES;
		    } else if (argv[i][j] == 's') {
          save_tmp = YES;
		    } else if (argv[i][j] == 'v') {
          verbose = YES;
		    } else if (argv[i][j] == 'd') {
          debug = YES;
		    } else if (argv[i][j] == 'q') {
          quiet = YES;
		    } else {
          printf ("Unrecognized option %s\n", argv[i]);
          exit (ERROR_RETURN);
		    }
		  }
	    } else if (input[0] == '\0') {
		strcpy (input, argv[i]);
	    } else {
		too_many = YES;
	    }
	}
	
	if (input[0] == '\0' || too_many) {
	    printf ("syntax:  calacs.e [-t] [-s] [-v] [-q] input \n");
	    exit (ERROR_RETURN);
	}

	/* Initialize the structure for managing trailer file comments */
	InitTrlBuf ();

	/* Copy command-line value for QUIET to structure */
	SetTrlQuietMode(quiet);
	
	/* Call the CALACS main program */
	if (CalAcsRun (input, printtime, save_tmp, verbose, debug)) {

        if (status == NOTHING_TO_DO){
            /* If there is just nothing to do, 
                as for ACQ images, just quit...     WJH 27Apr1999 */
            status = 0;
	        sprintf (MsgText, "CALACS did NOT process %s", input);
	        trlmessage (MsgText);
            exit(0); 
        } else {
	        /* Error during processing */
	        sprintf (MsgText, "CALACS processing NOT completed for %s", input);
		    trlerror (MsgText);
            /* Added 19 Mar 1999 - provides interpretation of error for user */
            WhichError (status);
		    CloseTrlBuf ();
	        exit (ERROR_RETURN);
        }
	}

	/* Successful completion */
	sprintf (MsgText, "CALACS completion for %s", input);
	trlmessage (MsgText);

	CloseTrlBuf ();
	
	/* Exit the program */
	exit(0);
}
{'fraction_non_alphanumeric': 0.15897184020956123, 'fraction_numerical': 0.010805500982318271, 'mean_word_length': 2.277360515021459, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2467131', 'n_tokens_mistral': 2282, 'n_tokens_neox': 2063, 'n_words': 649}