2023-12-23 07:18:30 +01:00
|
|
|
//go:build linux
|
2023-07-17 03:23:26 +02:00
|
|
|
|
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
2023-12-23 07:18:30 +01:00
|
|
|
"github.com/quexten/goldwarden/autotype"
|
2023-07-17 03:23:26 +02:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
var autofillCmd = &cobra.Command{
|
2023-12-23 07:18:30 +01:00
|
|
|
Use: "autotype",
|
|
|
|
Short: "Autotype credentials",
|
|
|
|
Long: `Autotype credentials`,
|
2023-07-17 03:23:26 +02:00
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
2023-12-23 07:18:30 +01:00
|
|
|
username, _ := cmd.Flags().GetString("username")
|
|
|
|
password, _ := cmd.Flags().GetString("password")
|
|
|
|
autotype.TypeString(username + "\t" + password)
|
2023-07-17 03:23:26 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
rootCmd.AddCommand(autofillCmd)
|
2023-12-23 07:18:30 +01:00
|
|
|
autofillCmd.PersistentFlags().String("username", "", "")
|
|
|
|
autofillCmd.PersistentFlags().String("password", "", "")
|
2023-07-17 03:23:26 +02:00
|
|
|
}
|