From 75787b99e02bcd7a9978159f05324487fc7f09b3 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Tue, 20 Oct 2009 15:26:18 +0000 Subject: [PATCH] Using getopt() for more coherence with the other tools --- src/tty.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tty.c b/src/tty.c index c66012e..6e5b653 100644 --- a/src/tty.c +++ b/src/tty.c @@ -57,7 +57,15 @@ static int _usage(void) /* main */ int main(int argc, char * argv[]) { - if(argc != 1) + int o; + + while((o = getopt(argc, argv, "")) != -1) + switch(o) + { + default: + return _usage(); + } + if(optind != argc) return _usage(); return _tty(); }