gohr

package module
v0.0.0-...-46734c4 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2017 License: MIT Imports: 5 Imported by: 0

README

gohr

Go Report Card Build Status

Unclutter your terminal using this small, but helpful Go package. gohr puts horizontal rulers in your terminal so that you can visually seperate parts of text.

hasit/gohr comes with:

  1. gohr - An importable package to use in your own Go programs.
  2. hr - A CLI tool.

hasit/gohr is a port of LuRst/hr.

asciicast of gohr

Installation

$ go get -u github.com/hasit/gohr/cmd/hr

This will download and install gohr package and hr executable.

Usage

gohr can be used as a package and as a standalone CLI tool.

As a package

To use it in your own Go program, import gohr and call gohr.Draw(args ...string) function.

package main

import "github.com/hasit/gohr"

func main() {
	gohr.DrawHr("-0-")
	gohr.DrawHr("-", "#")
	gohr.DrawHr(".", "\\", "/")
}
As a CLI tool

To use it as a standalone CLI tool, run hr from your terminal.

$ hr
##########

You can provide a symbol of your choice as a command line argument.

$ hr 'o'
oooooooooo

You can also provide multiple patterns as arguments seperated by spaces.

$ hr '-' '#' '-'
----------
##########
----------
$ hr '-o-' '#' '-o-'
-o--o--o--
##########
-o--o--o--

Contribution

Feel free to ask questions, post issues and open pull requests.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Draw

func Draw(patterns ...string)

Draw fills a row with '#' by default (if no arguments are provided) or takes arguments and prints each pattern on a new line.

Types

This section is empty.

Directories

Path Synopsis
cmd
hr

Jump to

Keyboard shortcuts

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