Ecosyste.ms: Awesome

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

https://github.com/alexcoder04/arrowprint

Go library for Arch-Linux-like CLI output
https://github.com/alexcoder04/arrowprint

arch arch-linux cli cli-tools color formatting go go-library golang library output

Last synced: about 2 months ago
JSON representation

Go library for Arch-Linux-like CLI output

Lists

README

        

# arrowprint

Use Arch-Linux-like output in your Go programs!

## Features

- Different levels and colors of messages
- `printf`-like formatting support
- Windows support through [mattn/go-colorable](https://github.com/mattn/go-colorable).

## Example

example screenshot

```go
arrowprint.InfoC("Starting program...")
step1 := "system"
arrowprint.Suc0("Initializing %s", step1)
arrowprint.Suc1("checking %s", step1)
arrowprint.Warn1("%s are not defined, this may lead to errors", "some variables")
arrowprint.InfoC("Running...")
arrowprint.Err0("An error occured, shutting down")
```

## Available functions

```go
// colon print, bold
// ` :: message`
func InfoC(msg string, args ...any) { }
func SucC(msg string, args ...any) { }
func WarnC(msg string, args ...any) { }
func ErrC(msg string, args ...any) { }

// level 0 print
// ` => message`
func Info0(msg string, args ...any) { }
func Suc0(msg string, args ...any) { }
func Warn0(msg string, args ...any) { }
func Err0(msg string, args ...any) { }

// level 1 print
// ` -> message`
func Info1(msg string, args ...any) { }
func Suc1(msg string, args ...any) { }
func Warn1(msg string, args ...any) { }
func Err1(msg string, args ...any) { }
```