cleanup
This commit is contained in:
parent
be0f532628
commit
05a68df896
15 changed files with 158 additions and 135 deletions
|
|
@ -25,7 +25,6 @@ func exit(err error) {
|
|||
}
|
||||
|
||||
func Run(arg string) {
|
||||
var err error
|
||||
ctx := context.Background()
|
||||
switch arg {
|
||||
case "new":
|
||||
|
|
@ -58,6 +57,9 @@ func Run(arg string) {
|
|||
}
|
||||
c := client()
|
||||
err = c.DeleteKey(ctx, id)
|
||||
if err != nil {
|
||||
exit(err)
|
||||
}
|
||||
case "approve":
|
||||
id, err := idFlags("approval id")
|
||||
if err != nil {
|
||||
|
|
@ -65,6 +67,9 @@ func Run(arg string) {
|
|||
}
|
||||
c := client()
|
||||
err = c.AcceptApproval(ctx, id)
|
||||
if err != nil {
|
||||
exit(err)
|
||||
}
|
||||
case "reject":
|
||||
id, err := idFlags("approval id")
|
||||
if err != nil {
|
||||
|
|
@ -72,6 +77,9 @@ func Run(arg string) {
|
|||
}
|
||||
c := client()
|
||||
err = c.RejectApproval(ctx, id)
|
||||
if err != nil {
|
||||
exit(err)
|
||||
}
|
||||
case "get":
|
||||
id, share, json, err := getFlags()
|
||||
if err != nil {
|
||||
|
|
@ -114,9 +122,6 @@ func Run(arg string) {
|
|||
}
|
||||
print(approvals)
|
||||
}
|
||||
if err != nil {
|
||||
exit(err)
|
||||
}
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue