24 lines
415 B
Go
24 lines
415 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"flag"
|
||
|
"fmt"
|
||
|
"os"
|
||
|
|
||
|
"go.jolheiser.com/confage"
|
||
|
|
||
|
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
fs := flag.NewFlagSet("confage", flag.ExitOnError)
|
||
|
secretKeyFlag := fs.String("secret-key", "", "Age secret key")
|
||
|
fs.StringVar(secretKeyFlag, "s", *secretKeyFlag, "--secret-key")
|
||
|
if err := fs.Parse(os.Args[1:]); err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
|
||
|
t := confage.MustNew(*secretKeyFlag, fs.Arg(0))
|
||
|
fmt.Println(t.String())
|
||
|
}
|