mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Move and refactor files and some more changes :3
This commit is contained in:
parent
781e520591
commit
303689ecbb
29 changed files with 1305 additions and 1160 deletions
40
cli/commands/info/info.go
Normal file
40
cli/commands/info/info.go
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
package info
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/ByteDream/crunchy-cli/cli/commands"
|
||||
"github.com/ByteDream/crunchy-cli/utils"
|
||||
crunchyUtils "github.com/ByteDream/crunchyroll-go/v3/utils"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var Cmd = &cobra.Command{
|
||||
Use: "info",
|
||||
Short: "Shows information about the logged in user",
|
||||
Args: cobra.MinimumNArgs(0),
|
||||
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
if err := commands.LoadCrunchy(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return info()
|
||||
},
|
||||
}
|
||||
|
||||
func info() error {
|
||||
account, err := utils.Crunchy.Account()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Println("Username: ", account.Username)
|
||||
fmt.Println("Email: ", account.Email)
|
||||
fmt.Println("Premium: ", utils.Crunchy.Config.Premium)
|
||||
fmt.Println("Interface language:", crunchyUtils.LocaleLanguage(account.PreferredCommunicationLanguage))
|
||||
fmt.Println("Subtitle language: ", crunchyUtils.LocaleLanguage(account.PreferredContentSubtitleLanguage))
|
||||
fmt.Println("Created: ", account.Created)
|
||||
fmt.Println("Account ID: ", account.AccountID)
|
||||
|
||||
return nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue