Vendored Dependencies, changed config extension to .toml

This commit is contained in:
2017-07-28 07:21:40 -05:00
parent b7bf623f39
commit ea63e80925
54 changed files with 3725 additions and 364 deletions

6
cfgedit/README.md Normal file
View File

@@ -0,0 +1,6 @@
cfgedit
====
This is a simple utility for editing toml config files from the command line.
It's basically a manual testing app for github.com/br0xen/user-config

BIN
cfgedit/cfgedit Executable file

Binary file not shown.

37
cfgedit/main.go Normal file
View File

@@ -0,0 +1,37 @@
package main
import (
"fmt"
"os"
userConfig "github.com/br0xen/user-config"
)
const AppName = "cfgedit"
func main() {
if len(os.Args) < 2 {
printHelp()
os.Exit(1)
}
whichConfig := os.Args[1]
cfg, err := userConfig.NewConfig(whichConfig)
if err != nil {
fmt.Println("Couldn't find config directory: " + whichConfig)
os.Exit(1)
}
op := "list"
if len(os.Args) >= 3 {
op = os.Args[2]
}
switch op {
case "list":
fmt.Println(cfg.GetKeyList())
}
}
func printHelp() {
fmt.Println("Usage: " + AppName + " <which config> <operation>")
fmt.Println(" <which-config> is ~/.config/<which-config>")
fmt.Println(" <operation> can just be 'list' right now")
}