Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jesusprubio/leg

🔈 Nicer CLIs foz lazy devs
https://github.com/jesusprubio/leg

cli elegant golang logger nice print

Last synced: about 2 months ago
JSON representation

🔈 Nicer CLIs foz lazy devs

Awesome Lists containing this project

README

        

# leg

**Archived**, now just using [slog](https://go.dev/blog/slog).

***

Screenshot 2023-03-06 at 14 18 25

[![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci]

Tiny wrapper to beauty command line application prototypes with a minimal effort.

- Prints to `stderr`.
- Thanks to [color](https://github.com/fatih/color) library:
- Cross platform.
- Respects [NO_COLOR](https://no-color.org).

## Install

```sg
go get -u github.com/jesusprubio/leg
```

### Dependencies

- [Go](https://go.dev/doc/install) stable version.

## Use

Visit the [tests](leg_test.go) to check more details.

```golang
leg.Head("mumu", "🐘", "0.1.0")
leg.Info("Informational message", "")
leg.Success("Successful operation", "")
leg.Warn("Warn message", "")
leg.Error("Error message", "")
leg.Wait("Waiting for something", "")
leg.Done("Something finished", "")

leg.Info("Informational message with scope", "scope-0")

fmt.Print("deleted line")
leg.Remove()

leg.Result("To standard output")
```

[doc-img]: https://pkg.go.dev/badge/github.com/jesusprubio/leg
[doc]: https://pkg.go.dev/github.com/jesusprubio/leg
[ci-img]: https://github.com/jesusprubio/leg/workflows/CI/badge.svg
[ci]: https://github.com/jesusprubio/leg/workflows/go.yml