terminal

package module
v0.0.0-...-0940f3f Latest Latest
Warning

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

Go to latest
Published: May 13, 2016 License: BSD-3-Clause Imports: 5 Imported by: 40

README

Terminal

Terminal is a simple golang package that provides basic terminal handling.

Terminal wraps color/format functions provided by ANSI escape code

Usage

package main

import (
  "github.com/wsxiaoys/terminal"
  "github.com/wsxiaoys/terminal/color"
)

func main() {
  terminal.Stdout.Color("y").
    Print("Hello world").Nl().
    Reset().
    Colorf("@{kW}Hello world\n")

  color.Print("@rHello world")
}

Check the godoc result for more details.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Stdout = &TerminalWriter{os.Stdout}
	Stderr = &TerminalWriter{os.Stderr}
)

Functions

This section is empty.

Types

type TerminalWriter

type TerminalWriter struct {
	io.Writer
}

func (*TerminalWriter) Clear

func (w *TerminalWriter) Clear() *TerminalWriter

func (*TerminalWriter) ClearLine

func (w *TerminalWriter) ClearLine() *TerminalWriter

func (*TerminalWriter) Color

func (w *TerminalWriter) Color(syntax string) *TerminalWriter

func (*TerminalWriter) Colorf

func (w *TerminalWriter) Colorf(format string, a ...interface{}) *TerminalWriter

func (*TerminalWriter) Down

func (w *TerminalWriter) Down(x int) *TerminalWriter

func (*TerminalWriter) Left

func (w *TerminalWriter) Left(x int) *TerminalWriter

func (*TerminalWriter) Move

func (w *TerminalWriter) Move(x, y int) *TerminalWriter

func (*TerminalWriter) Nl

func (w *TerminalWriter) Nl(a ...interface{}) *TerminalWriter

func (*TerminalWriter) Print

func (w *TerminalWriter) Print(a ...interface{}) *TerminalWriter

func (*TerminalWriter) Reset

func (w *TerminalWriter) Reset() *TerminalWriter

func (*TerminalWriter) Right

func (w *TerminalWriter) Right(x int) *TerminalWriter

func (*TerminalWriter) Up

func (w *TerminalWriter) Up(x int) *TerminalWriter

Directories

Path Synopsis
The colors package provide a simple way to bring colorful characters to terminal interface.
The colors package provide a simple way to bring colorful characters to terminal interface.

Jump to

Keyboard shortcuts

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