logo

inaban

Unnamed repository; edit this file 'description' to name the repository.
commit: 5b0b0167a0437ed9f685a06acfadcad103af0281
parent: 90f39641e974b5e69bd25a7b1f952dee8f7bb883
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed,  3 Jul 2019 06:30:13 +0200

Move usage info to one function

Diffstat:

Minaban.c9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/inaban.c b/inaban.c @@ -631,6 +631,11 @@ sigterm_handler(int signal) wl_display_terminate(server.wl_display); } +void +usage(char *argv0) { + printf("Usage: %s [-s startup command]\n", argv0); +} + int main(int argc, char *argv[]) { @@ -643,12 +648,12 @@ main(int argc, char *argv[]) switch(c) { case 's': startup_cmd = optarg; break; - default: printf("Usage: %s [-s startup command]\n", argv[0]); return 0; + default: usage(argv[0]); return 0; } } if(optind < argc) { - printf("Usage: %s [-s startup command]\n", argv[0]); + usage(argv[0]); return 0; }