cliarg

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2019 License: ISC Imports: 1 Imported by: 1

README

Cliarg

Build Status Coverage Status Go Report Card GoDoc

A simple way to store and modify command line executions.

Using

Using cliarg is as simple as adding struct tags. Values are marshalled in order.

Example Struct
type ExampleCliarg struct {
	Arg         string `cliarg:"arg"` // The arg tag places the value of the field in the command line
	Option      string `cliarg:"-o"`  // An option tag places the tag on the command line, followed by the value of the field
	Flag        bool   `cliarg:"-f"`  // A flag tag either places the flag in the command line or not, based on the value of field, occurs if boolean
}
In Use
ExampleCliarg{"/bin/arg", "option", true}

Results

/bin/arg -o option -f

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(v interface{}) []string

Marshal returns the command line encoding of v.

Types

This section is empty.

Jump to

Keyboard shortcuts

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