view libcommon/globalopts.c @ 225:208ae1633f6c

simtool code: sysmo.c renamed to sjs1_hacks.c, comments changed to clarify that these special commands apply only to the recently discontinued SJS1 cards and not to the SJA2 successor.
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 10 Mar 2021 19:39:33 +0000
parents 91bcf84a5323
children
line wrap: on
line source

/*
 * This module implements parsing of global command line options.
 */

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

extern unsigned select_reader_num;

parse_global_options(argc, argv)
	char **argv;
{
	extern char *optarg;
	int c;

	while ((c = getopt(argc, argv, "+p:")) != EOF) {
		switch (c) {
		case 'p':
			select_reader_num = atoi(optarg);
			continue;
		case '?':
		default:
			/* error msg already printed */
			exit(1);
		}
	}
	return(0);
}