Skip to content

kemokemo/colout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

colout (colored output tool)

License: MIT Go Report Card Powered By: GoReleaser

It's a simple and tiny tool for getting colored output in scripts.

sample

Usage

$ colout -h
A CLI tool that makes it easy to use colored output.

Usage:
  colout [command]

Available Commands:
  error       colored red output
  help        Help about any command
  info        colored blue output
  success     colored green output
  version     Print the version number
  warn        colored yellow output

Flags:
  -h, --help   help for colout

Use "colout [command] --help" for more information about a command.

Examples

Both args and standard input are available

The subcommands specify the color, and the wording is passed as an argument or standard input.

colout success "Successfully done."
echo "Successfully done." | colout success

All of the above examples result in the following output.

sample-outout

Shell script

#!/bin/bash

# do-your-work

if [ $? = 0 ]; then
  colout success "Successfully done."
else
  colout error "An error has occurred."
fi

Power shell

# do-your-work

if ( $? ){
  colout success "Successfully done."
}
else {
  colout error "An error has occurred."
}

Windows batch

@echo off

rem do-your-work

if %errorlevel% == 0 (
  colout success "Successfully done."
) else (
  colout error "An error has occurred."
) 

How to install

Homebrew

brew install kemokemo/tap/colout

Scoop

First, add my scoop-bucket.

scoop bucket add kemokemo-bucket https://github.com/kemokemo/scoop-bucket.git

Next, install this app by running the following.

scoop install colout

Build yourself

go get github.com/kemokemo/colout

Binary

Download from the release page, unpack the archive and put the binary somewhere in your PATH.

License

MIT

Author

kemokemo

About

🎨 It's a simple and tiny tool for getting colored output in scripts.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages