backlog of changes from the uconsole
This commit is contained in:
@@ -1,12 +1,26 @@
|
||||
#include <stdio.h>
|
||||
#include <stdio.h> /* fprintf(3), stderr */
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h> /* getopt(3) */
|
||||
|
||||
/* The philosophical bits - /should this be a shell script?/ -
|
||||
* are more complicated than the actual program. sed(1) is not currently a part
|
||||
* of this project so there shouldn't be reliance on it. */
|
||||
static int lines = 10; /* POSIX.1 */
|
||||
static char *program_name = "head";
|
||||
|
||||
int main(int argc, char *argv[]){
|
||||
char *argv0 = argv[0];
|
||||
size_t i;
|
||||
int c;
|
||||
extern char *optarg;
|
||||
extern int opterr, optind, optopt;
|
||||
|
||||
|
||||
if(argc > 0)
|
||||
program_name = argv[0];
|
||||
|
||||
while((c = getopt(argc, argv, "n:")) != -1)
|
||||
switch(c){
|
||||
case 'n':
|
||||
break;
|
||||
default:
|
||||
#ifdef IGIT /* parse -[digit] options */
|
||||
#endif /* ifdef IGIT */
|
||||
usage: fprintf(stderr, "Usage: %s (-n [lines]) (file...)\n",
|
||||
program_name);
|
||||
return EX_USAGE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user