gocli

module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2017 License: CC0-1.0

README

gocli - Minimal Packages for Command-Line Interface

Build Status GitHub license

Install

$ go get -u github.com/spiegel-im-spiegel/gocli

Installing by dep.

$ dep ensure -add github.com/spiegel-im-spiegel/gocli

Example

package main

import (
    "fmt"

    "github.com/spiegel-im-spiegel/gocli/exitcode"
    "github.com/spiegel-im-spiegel/gocli/rwi"
)

func run(ui *rwi.RWI) exitcode.ExitCode {
    ui.Outputln("Hello world")
    return exitcode.Normal
}

func main() {
    run(rwi.New(
        rwi.Reader(os.Stdin),
        rwi.Writer(os.Stdout),
        rwi.ErrorWriter(os.Stderr),
    )).Exit()
}

Directories

Path Synopsis
Package exitcode : OS exit code enumeration These codes are licensed under CC0.
Package exitcode : OS exit code enumeration These codes are licensed under CC0.
Package rwi : Reader/Writer Interface for command-line These codes are licensed under CC0.
Package rwi : Reader/Writer Interface for command-line These codes are licensed under CC0.

Jump to

Keyboard shortcuts

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