From 561b4ba5999e582154712d991d8abbb291e1d760 Mon Sep 17 00:00:00 2001 From: Murilo Pereira Date: Sun, 12 Jun 2011 21:39:11 -0300 Subject: [PATCH] Pass program name as argument to usage(). --- src/ttysolitaire.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ttysolitaire.c b/src/ttysolitaire.c index d7baadc..c178c8e 100644 --- a/src/ttysolitaire.c +++ b/src/ttysolitaire.c @@ -21,7 +21,7 @@ void draw_greeting() { mvprintw(15, 19, "Press the space bar to play or q to quit."); } -void usage() { +void usage(const char *program_name) { printf("usage: %s [-v|--version] [-h|--help] [-p|--passes=NUMBER]\n", program_name); printf(" -v, --version Show version\n"); printf(" -h, --help Show this message\n"); @@ -64,7 +64,7 @@ int main(int argc, char *argv[]) { break; case 'h': default: - usage(); + usage(program_name); exit(0); } }