Skip to content

Commit

Permalink
Merge pull request #523 from ilpianista/kdialog
Browse files Browse the repository at this point in the history
Add support for kdialog
  • Loading branch information
mtibben authored Feb 13, 2020
2 parents 8403634 + b5a6d8f commit 3105570
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions prompt/kdialog.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package prompt

import (
"os/exec"
"strings"
)

func KDialogPrompt(prompt string) (string, error) {
cmd := exec.Command("kdialog", "--inputbox", prompt, "--title", "aws-vault")

out, err := cmd.Output()
if err != nil {
return "", err
}

return strings.TrimSpace(string(out)), nil
}

func init() {
Methods["kdialog"] = KDialogPrompt
}

0 comments on commit 3105570

Please sign in to comment.