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 1 month ago
JSON representation
Go library for Arch-Linux-like CLI output
- Host: GitHub
- URL: https://github.com/alexcoder04/arrowprint
- Owner: alexcoder04
- License: gpl-3.0
- Created: 2022-05-30T07:57:27.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-28T10:39:50.000Z (almost 2 years ago)
- Last Synced: 2024-05-16T10:30:15.098Z (4 months ago)
- Topics: arch, arch-linux, cli, cli-tools, color, formatting, go, go-library, golang, library, output
- Language: Go
- Homepage:
- Size: 61.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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
```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) { }
```