2023-08-21 18:37:34 +02:00
|
|
|
//go:build !noautofill
|
2023-07-17 03:23:26 +02:00
|
|
|
|
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/quexten/goldwarden/autofill"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
var autofillCmd = &cobra.Command{
|
|
|
|
Use: "autofill",
|
|
|
|
Short: "Autofill credentials",
|
|
|
|
Long: `Autofill credentials`,
|
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
layout := cmd.Flag("layout").Value.String()
|
2023-07-18 22:08:37 +02:00
|
|
|
useCopyPaste, _ := cmd.Flags().GetBool("use-copy-paste")
|
2023-08-21 18:37:34 +02:00
|
|
|
autofill.Run(layout, useCopyPaste, commandClient)
|
2023-07-17 03:23:26 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
rootCmd.AddCommand(autofillCmd)
|
|
|
|
autofillCmd.PersistentFlags().String("layout", "qwerty", "")
|
2023-07-18 22:08:37 +02:00
|
|
|
autofillCmd.PersistentFlags().Bool("use-copy-paste", false, "")
|
2023-07-17 03:23:26 +02:00
|
|
|
}
|