colout

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2020 License: MIT Imports: 1 Imported by: 0

README

colout (colored output tool)

Go Report Card

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

Documentation

Overview

Copyright © 2020 kemokemo <t2wonderland@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL