From fa49d17486e602659c02944de2eb0c37c1668803 Mon Sep 17 00:00:00 2001 From: Foil-hat-guy Date: Sun, 20 Apr 2025 23:44:39 +0300 Subject: [PATCH] README.md file is added. --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..3491737 --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +### The "UI" package + +This package provides --verbose and --quiet flag features to your cli. +It recognize both short and long flags. The package contains three functions: +- **PrintOut** to print regular messages unless --quiet flag is set. +- **PrintVerbose** to print messages only if --verbose flag is set, but --quiet +flag is not. +- **SetupOutputMode** to reconfigure output mode in the runtime. + +------------- + +### Usage +1. Download the package by **go get** command: +```shell +go get code.foilhatguy.casa/pub/ui +``` +2. Import package to your golang code: +```go +import ( + "code.foilhatguy.casa/pub/ui" +) +``` +There is no need for additional configuration. The package have its own **init** +function to detect --verbose and --quiet flags. +3. Use **PrintOut** and **PrintVerbose** functions to print +messages to the standard output: +```go + ui.PrintOut("Some regular message.") + ui.PrintVerbose("Some message printed only if --verbose flag is set.") +``` \ No newline at end of file