File tree 1 file changed +12
-0
lines changed 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 7
7
"encoding/json"
8
8
"errors"
9
9
"fmt"
10
+ "github.com/atotto/clipboard"
10
11
"github.com/kirsle/configdir"
11
12
"golang.org/x/crypto/ssh/terminal"
12
13
"io/fs"
@@ -20,6 +21,7 @@ const DELIMSIZE int = 69
20
21
// Over-ride settings via cmd line
21
22
type SettingsOverride struct {
22
23
ShowPasswords bool
24
+ CopyPassword bool
23
25
}
24
26
25
27
// Settings structure for local config
@@ -389,6 +391,16 @@ func setShowPasswords() error {
389
391
return nil
390
392
}
391
393
394
+ // Copy the password to clipboard - only for single listings or single search results
395
+ func setCopyPasswordToClipboard () error {
396
+ settingsRider .CopyPassword = true
397
+ return nil
398
+ }
399
+
400
+ func copyPasswordToClipboard (passwd string ) {
401
+ clipboard .WriteAll (passwd )
402
+ }
403
+
392
404
// Generate a random file name
393
405
func randomFileName (folder string , suffix string ) string {
394
406
You can’t perform that action at this time.
0 commit comments