added env variable
This commit is contained in:
parent
05a68df896
commit
1d5d900f26
2 changed files with 20 additions and 7 deletions
|
|
@ -43,11 +43,8 @@ func Run(arg string) {
|
|||
if err != nil {
|
||||
exit(err)
|
||||
}
|
||||
switch k.Type {
|
||||
case core.Plain:
|
||||
fmt.Println("Key ID:", k.ID)
|
||||
case core.Shamir:
|
||||
fmt.Println("Key ID:", k.ID)
|
||||
fmt.Println("Key ID:", k.ID)
|
||||
if k.Type == core.Shamir {
|
||||
fmt.Println("Key Share:", k.Key)
|
||||
}
|
||||
case "del":
|
||||
|
|
@ -94,11 +91,11 @@ func Run(arg string) {
|
|||
if err != nil {
|
||||
exit(err)
|
||||
}
|
||||
key.Key = out
|
||||
if json {
|
||||
key.Key = out
|
||||
jsonOutput(key) // does not return
|
||||
}
|
||||
fmt.Println(key.Key)
|
||||
fmt.Println(out)
|
||||
case "ls":
|
||||
json := outputFlags()
|
||||
c := client()
|
||||
|
|
@ -164,6 +161,9 @@ func getFlags() (id, share string, json bool, err error) {
|
|||
if id == "" {
|
||||
err = errors.New("missing flag: id")
|
||||
}
|
||||
if share == "" {
|
||||
share = os.Getenv("KEYCTL_SHARE")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue