From: Brian McGillion Date: Fri, 11 Nov 2011 08:34:04 +0000 (+0200) Subject: Add usage X-Git-Tag: accepted/trunk/20130107.204027~42^2^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=967f209ce57e11bdc900f5b8de89958358127946;p=platform%2Fupstream%2Fsmack.git Add usage --- diff --git a/utils/smackload.c b/utils/smackload.c index b86ee81..af93153 100644 --- a/utils/smackload.c +++ b/utils/smackload.c @@ -26,6 +26,12 @@ #include #include +static int usage(const char *bin) +{ + fprintf(stderr, "Usage: %s [-c] \n", bin); + exit(1); +} + int main(int argc, char **argv) { int clear = 0; @@ -37,11 +43,13 @@ int main(int argc, char **argv) clear = 1; break; default: - fprintf(stderr, "Usage: %s [-c] \n", argv[0]); - exit(1); + usage(argv[0]); } } + if (optind == argc) + usage(argv[0]); + if (is_smackfs_mounted() != 1) { fprintf(stderr, "ERROR: SmackFS is not mounted.\n"); return -1;