From bb1b42028440302a1b95ecb9c964963edc2572d5 Mon Sep 17 00:00:00 2001 From: pacien Date: Tue, 9 Jan 2018 16:03:45 +0100 Subject: Extract help func Signed-off-by: pacien --- src/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index d791a93..ddcc6dc 100644 --- a/src/main.c +++ b/src/main.c @@ -4,6 +4,13 @@ #include #include "gui/gui.h" +static inline void print_help() { + printf("Usage: morph [--help] \n\n" + "To use the morphing, you need to put two correct paths to image files.\n\n" + "Accepted input imaege formats are: ICO, CUR, BMP, PNM, XPM, LBM, PCX, GIF, JPEG, PNG, TGA, TIFF, and XV.\n\n" + "Project made by: Pacien TRAN-GIRARD and Adam NAILI\n"); +} + int main(int argc, char **argv) { int opt = 0; int help = -1; @@ -23,8 +30,7 @@ int main(int argc, char **argv) { } } if (help == 0) { - printf( - "--Morphing's Help--\nTo use the morphing, you need to put two correct paths to image files.\n\nCorrect image format :\nICO(Icon)/CUR(Cursor)/BMP, PNM (PPM/PGM/PBM), XPM, LBM(IFF ILBM), PCX, GIF, JPEG, PNG, TGA, TIFF, and XV.\n\nMorphing made by:\n Pacien TRAN-GIRARD and Adam NAILI\n"); + print_help(); } else { int nbArg = argc - optind; if (nbArg < 2) { -- cgit v1.2.3