cmd

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use: "bilisubdl [id] [flags]",
	Run: func(cmd *cobra.Command, args []string) {
		var err error
		switch {
		case listLang:
			err = RunListLanguage(args[0])
		case listSection:
			err = RunListSection(args[0])
		case timeline != "":
			err = RunTimeline()
		case search != "":
			err = RunSearch()
		case dlepisode:
			err = RunDlEpisode(args)
		default:
			for _, s := range args {
				err := Run(s)
				if err != nil {
					fmt.Fprintln(os.Stderr, "ID:", s, err)
				}
			}
		}
		if err != nil {
			fmt.Fprintln(os.Stderr, err)
			os.Exit(1)
		}
	},
	Example: "bilisubdl 37738 1042594 -l th\nbilisubdl 37738 --list-subs\nbilisubdl --timeline=sun",
}

Functions

func Run

func Run(id string) error

func RunDlEpisode added in v1.7.0

func RunDlEpisode(ids []string) error

func RunListLanguage added in v1.6.0

func RunListLanguage(id string) error

func RunListSection added in v1.6.0

func RunListSection(id string) error

func RunSearch added in v1.5.0

func RunSearch() error

func RunTimeline added in v1.4.0

func RunTimeline() error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL