Categorygithub.com/skeptycal/cli
modulepackage
0.3.0
Repository: https://github.com/skeptycal/cli.git
Documentation: pkg.go.dev

# README

gorepotemplate

Tricky and fun utilities for Go programs.


GitHub Workflow Status Codecov

Contributor Covenant

Twitter Follow GitHub followers


Getting Started

Prerequisites

Developed with $( go version; ). Go is extremely backwards compatible and semver stable. Nearly any v1.x should work fine.


Installation

To use this repo as a template for your own project:

gh repo create -y --public --template "https://github.com/skeptycal/gorepotemplate"

Clone this repo to test and contribute:

# add repo to $GOPATH (xxxxxx is your computer login username)
go get github.com/xxxxxx/gorepotemplate

cd ${GOPATH}/src/github.com/xxxxxx/gorepotemplate

# test results and coverage info
./go.test.sh

# install as a utility package
go install

Use the Issues and PR templates on the GitHub repo page to contribute.


Basic Usage

This is a copy of the example script available in the cmd/example/gorepotemplate folder:

package main

import "github.com/skeptycal/gorepotemplate"

func main() {
    gorepotemplate.Example()
}

To try it out:

# change to the sample folder
cd cmd/example/gorepotemplate

# run the main.go program
go run ./main.go

# to compile as an executable
go build

Code of Conduct and Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us. Please read the Code of Conduct for details before submitting anything.


Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.


Contributors and Inspiration

See also the list of contributors who participated in this project.


License

Licensed under the MIT https://opensource.org/licenses/MIT - see the LICENSE file for details.

# Packages

No description provided by the author
Package terminal provides information about the state of the terminal.

# Functions

Background - Change background color of string: tm.Background("string", tm.RED) .
BasicEncode encodes a basic (3-4 bit) ANSI color code.
Bold - Make bold.
No description provided by the author
Clear screen.
Color - Apply given color to string: tm.Color("RED STRING", tm.RED) .
Columns returns the number of columns in the terminal, similar to the COLUMNS environment variable on macOS and Linux systems.
No description provided by the author
CurrentHeight gets current height.
Flush buffer and ensure that it will not overflow screen.
GetWinSize returns device caps for the terminal.
GetXY gets relative or absolute coordinates To get relative, set PCT flag to number: // Get 10% of total width to `x` and 20 to y x, y = tm.GetXY(10|tm.PCT, 20) .
Height gets console height.
No description provided by the author
No description provided by the author
MoveCursor - Move cursor to given position.
MoveCursorBackward - Move cursor backward relative the current position.
MoveCursorDown - Move cursor down relative the current position.
MoveCursorForward - Move cursor forward relative the current position.
MoveCursorUp - Move cursor up relative the current position.
MoveTo - Move string to possition.
New returns a new ANSI compatible terminal interface based on os.Stdout with ANSI support enabled by default.
No description provided by the author
NewLogger creates a new logrus logger that is compatible with the go log package and has terminal stderr defaults set.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ResetLine returns carrier to start of line.
Width gets console width.
Wrap splits a string into lines no longer than width.

# Constants

List of possible colors.
List of possible colors.
List of possible colors.
List of possible colors.
List of possible colors.
No description provided by the author
List of possible colors.
No description provided by the author
ResetColor - Reset to default color.
ResetLineConst - Return cursor to start of line and clean it.
List of possible colors.
List of possible colors.

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
Screen - Global screen buffer Its not recommended write to buffer dirrectly, use package Print,Printf,Println fucntions instead.

# Structs

No description provided by the author
No description provided by the author

# Interfaces

CLI implements an ANSI compatible terminal interface.
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author