/* * seq2 -> advanced clone of unix seq * Copyright (C) cappa * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #if HAVE_STRING_H #include #endif #if HAVE_GETOPT_H #include #endif #include "seq2.h" int main(int argc, char *argv[]) { int fastmode, increment, new_line, leadz; double start, end; char c; char *text=NULL; char *output=NULL; //need this shit for getopt extern char *optarg; new_line = start = increment = 1; end = 10; leadz = fastmode = 0; while((c = getopt(argc, argv, "o:lni:f:t:s:e:vh")) != -1) { switch(c) { case 'o': output = optarg; break; case 'v': version(argv[0]); exit(0); break; case 'h': help(argv[0]); exit(0); break; case 's': start = atoi(optarg); break; case 'e': end = atoi(optarg); break; case 'i': increment = atoi(optarg); break; case 'n': new_line = 0; break; case 'f': fastmode = atoi(optarg); break; case 't': text = optarg; break; case 'l': leadz = 1; break; case '?': none(argv[0]); exit(0); break; } } if (end == start) { fprintf(stderr, "start & end are same. Exiting...\n"); sleep(2); exit(2); } else if (end < start) { fprintf(stderr, "start is greater than end. Exiting...\n"); sleep(2); exit(2); } else { counter(start, end, text, fastmode, increment, new_line, leadz, output); } }