mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 05:37:05 +02:00
Transfer command refactoring
Make transfer command processing even more modular
This commit is contained in:
parent
7c85ba05ab
commit
a9e07915ce
7 changed files with 236 additions and 179 deletions
|
@ -25,6 +25,7 @@ import (
|
|||
"github.com/spf13/viper"
|
||||
"go.uploadedlobster.com/scotty/internal/auth"
|
||||
"go.uploadedlobster.com/scotty/internal/backends"
|
||||
"go.uploadedlobster.com/scotty/internal/cli"
|
||||
"go.uploadedlobster.com/scotty/internal/models"
|
||||
"go.uploadedlobster.com/scotty/internal/storage"
|
||||
"golang.org/x/oauth2"
|
||||
|
@ -36,7 +37,7 @@ var authCmd = &cobra.Command{
|
|||
Short: "Authenticate with a backend",
|
||||
Long: `For backends requiring authentication this command can be used to authenticate.`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
serviceName, serviceConfig := getConfigFromFlag(cmd, "service")
|
||||
serviceName, serviceConfig := cli.GetConfigFromFlag(cmd, "service")
|
||||
backend, err := backends.ResolveBackend[models.OAuth2Authenticator](serviceConfig)
|
||||
cobra.CheckErr(err)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue