From 7929b03df43057a60e60323164f74fbd79c65512 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Sun, 16 Sep 2007 00:30:10 +0000 Subject: Add -s,--silent so it doesnt display the instructions and wait for input before continuing. -h,--help to get the usage message git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14727 a1c6a512-1295-4272-9138-f99709370657 --- rbutil/e200rpatcher/e200rpatcher.c | 60 +++++++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 20 deletions(-) (limited to 'rbutil/e200rpatcher/e200rpatcher.c') diff --git a/rbutil/e200rpatcher/e200rpatcher.c b/rbutil/e200rpatcher/e200rpatcher.c index 8d0c674a5e..e71a771e04 100644 --- a/rbutil/e200rpatcher/e200rpatcher.c +++ b/rbutil/e200rpatcher/e200rpatcher.c @@ -28,6 +28,7 @@ #include #include #include +#include "stdbool.h" #include "bootimg.h" @@ -183,37 +184,56 @@ found: usb_close(dh); } - +void print_usage(void) +{ + fprintf(stderr,"Usage: e200rpatcher [options]\n"); + fprintf(stderr,"Options:\n"); + fprintf(stderr," -s, --silent\t\tDont display instructions\n"); +} int main(int argc, char* argv[]) { char input[4]; - - /* We don't use the arguments */ - (void)argc; - (void)argv; + int silent = 0; + int i; + + /* check args */ + if ((argc > 1) && ((strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"--help")==0))) { + print_usage(); + return 1; + } + for (i=1;i