go-shell-variables-file

command module
v0.0.0-...-37a3760 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2018 License: MIT Imports: 2 Imported by: 0

README

Build Status codecov Go Report Card GoDoc

go-shell-variables-file

Usage

As A Package
package main

import (
	"fmt"

	"github.com/blp1526/go-shell-variables-file/pkg/svf"
)

func main() {
	path := "/etc/os-release"
	s, _ := svf.ReadFile(path)
	key := "VERSION"
	value, _ := s.GetValue(key)
	fmt.Printf("path: %s, key: %s, value %s\n", path, key, value)
}

then, go run main.go

path: /etc/os-release, key: VERSION, value 18.04.1 LTS (Bionic Beaver)
As A CLI
$ svf values /etc/os-release --key VERSION
18.04.1 LTS (Bionic Beaver)

Build CLI

$ make

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
cmd
svf

Jump to

Keyboard shortcuts

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