From d1921985b3de64f4047dcbe22ffbb1d95644fc0a Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Mon, 16 Sep 2024 10:45:07 -0500 Subject: [PATCH] replace readme help --- README.md | 32 ++++++++++---------------------- pkgs/oizys-nim/src/oizys.nim | 7 +++---- 2 files changed, 13 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 086b280..b898191 100644 --- a/README.md +++ b/README.md @@ -55,30 +55,18 @@ nix run "github:daylinmorgan/oizys" ``` nix begat oizys - Usage: - oizys [command] + oizys {SUBCMD} [sub-command options & parameters] -Available Commands: - build nix build - cache build and push to cachix - checks nix build checks - ci offload build to GHA - dry poor man's nix flake check - help Help about any command - os nixos-rebuild wrapper - output show nixosConfiguration attr - update update and run nixos rebuild - -Flags: - --debug show debug output - --flake string path to flake ($OIZYS_DIR or $HOME/oizys) - -h, --help help for oizys - --host string host(s) to build (current host) - --reset-cache set narinfo-cache-negative-ttl to 0 - -v, --verbose show verbose output - -Use "oizys [command] --help" for more information about a command. +subcommands: + help print comprehensive or per-cmd help + build nix build + cache build and push to cachix + ci trigger GHA update flow + dry dry run build + os nixos-rebuild + output output + update update and run nixos-rebuild ``` ## oizys? diff --git a/pkgs/oizys-nim/src/oizys.nim b/pkgs/oizys-nim/src/oizys.nim index 1b92865..ac2ad92 100644 --- a/pkgs/oizys-nim/src/oizys.nim +++ b/pkgs/oizys-nim/src/oizys.nim @@ -95,10 +95,9 @@ proc setupCligen() = let isColor = getEnv("NO_COLOR") == "" if clCfg.useMulti == "": clCfg.useMulti = - if isColor: - "${doc}\e[1mUsage\e[m:\n $command {SUBCMD} [sub-command options & parameters]\n\n\e[1msubcommands\e[m:\n$subcmds" - else: - "${doc}Usage:\n $command {SUBCMD} [sub-command options & parameters]\n\nsubcommands:\n$subcmds" + if isColor: "${doc}\e[1mUsage\e[m:\n $command {SUBCMD} [sub-command options & parameters]\n\n\e[1msubcommands\e[m:\n$subcmds" + else: "${doc}Usage:\n $command {SUBCMD} [sub-command options & parameters]\n\nsubcommands:\n$subcmds" + if not isColor: return if clCfg.helpAttr.len == 0: clCfg.helpAttr = {"cmd": "\e[1;36m", "clDescrip": "", "clDflVal": "\e[33m",