sheepy

build system (sheepy) and package manager (spm) for C
git clone https://spartatek.se/git/sheepy.git
Log | Files | Refs | README | LICENSE

commit 0967c9dab648005ae871be1d9604221e1b7325b0
parent ce4f018e5629cf978120951226a8a7d61eb8a3ed
Author: Remy Noulin <loader2x@gmail.com>
Date:   Tue,  4 Aug 2020 13:45:55 +0200

accept -h, --help and help to print help in sheepy and spm

src/sheepy.c | 7 ++++---
src/spm.c    | 7 ++++---
2 files changed, 8 insertions(+), 6 deletions(-)

Diffstat:
Msrc/sheepy.c | 7++++---
Msrc/spm.c | 7++++---
2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/sheepy.c b/src/sheepy.c @@ -229,17 +229,18 @@ int MAIN(int ARGC, char** ARGV) { goto sheepyRun; } splash(); - printf("Nothing to do. sheepy -h for help"); { + printf("Nothing to do. sheepy -h for help\n"); { printf("\n"); - XFAILURE + goto help; } } // after this line, argc > 1, there is at least one argument - if (eqS(argv[1], "-h")) { + if (eqS(argv[1], "-h") || eqS(argv[1], "--help") || eqS(argv[1], "help")) { terminateG(bin); splash(); + help: putsG(BLD GRN "Sheepy Help (build system)" RST); putsG(" " UDL YLW "Environment" RST); if (!startsWithG(argv[0], "/usr/local/bin/")) { diff --git a/src/spm.c b/src/spm.c @@ -134,8 +134,8 @@ int MAIN(int ARGC, char** ARGV) { // check arguments // need at least 1 argument if (argc < 2) { - puts("Nothing to do. "BLD GRN"spm help"RST" for help"); { - XFAILURE + puts("Nothing to do. "BLD GRN"spm help"RST" for help\n"); { + goto help; } } @@ -144,7 +144,8 @@ int MAIN(int ARGC, char** ARGV) { //logVarG(localPackageDir); - if (eqG(argv[1], "help")) { + if (eqS(argv[1], "-h") || eqS(argv[1], "--help") || eqS(argv[1], "help")) { + help: putsG(BLD GRN "Sheepy Package Manager Help" RST); putsG(" " UDL YLW "Environment" RST); putsG(" The configuration is located in " UDL HOME_DIR CONFIG_NAME RST "\n");