mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Rename getCmd variable to downloadCmd
This commit is contained in:
parent
fd3d945c3a
commit
be3d33744f
1 changed files with 8 additions and 8 deletions
|
|
@ -28,7 +28,7 @@ var (
|
||||||
downloadGoroutinesFlag int
|
downloadGoroutinesFlag int
|
||||||
)
|
)
|
||||||
|
|
||||||
var getCmd = &cobra.Command{
|
var downloadCmd = &cobra.Command{
|
||||||
Use: "download",
|
Use: "download",
|
||||||
Short: "Download a video",
|
Short: "Download a video",
|
||||||
Args: cobra.MinimumNArgs(1),
|
Args: cobra.MinimumNArgs(1),
|
||||||
|
|
@ -72,23 +72,23 @@ var getCmd = &cobra.Command{
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
getCmd.Flags().StringVarP(&downloadAudioFlag, "audio",
|
downloadCmd.Flags().StringVarP(&downloadAudioFlag, "audio",
|
||||||
"a",
|
"a",
|
||||||
string(systemLocale(false)),
|
string(systemLocale(false)),
|
||||||
"The locale of the audio. Available locales: "+strings.Join(allLocalesAsStrings(), ", "))
|
"The locale of the audio. Available locales: "+strings.Join(allLocalesAsStrings(), ", "))
|
||||||
getCmd.Flags().StringVarP(&downloadSubtitleFlag,
|
downloadCmd.Flags().StringVarP(&downloadSubtitleFlag,
|
||||||
"subtitle",
|
"subtitle",
|
||||||
"s",
|
"s",
|
||||||
"",
|
"",
|
||||||
"The locale of the subtitle. Available locales: "+strings.Join(allLocalesAsStrings(), ", "))
|
"The locale of the subtitle. Available locales: "+strings.Join(allLocalesAsStrings(), ", "))
|
||||||
|
|
||||||
cwd, _ := os.Getwd()
|
cwd, _ := os.Getwd()
|
||||||
getCmd.Flags().StringVarP(&downloadDirectoryFlag,
|
downloadCmd.Flags().StringVarP(&downloadDirectoryFlag,
|
||||||
"directory",
|
"directory",
|
||||||
"d",
|
"d",
|
||||||
cwd,
|
cwd,
|
||||||
"The directory to download the file(s) into")
|
"The directory to download the file(s) into")
|
||||||
getCmd.Flags().StringVarP(&downloadOutputFlag,
|
downloadCmd.Flags().StringVarP(&downloadOutputFlag,
|
||||||
"output",
|
"output",
|
||||||
"o",
|
"o",
|
||||||
"{title}.ts",
|
"{title}.ts",
|
||||||
|
|
@ -104,7 +104,7 @@ func init() {
|
||||||
"\t{audio} » Audio locale of the video\n"+
|
"\t{audio} » Audio locale of the video\n"+
|
||||||
"\t{subtitle} » Subtitle locale of the video")
|
"\t{subtitle} » Subtitle locale of the video")
|
||||||
|
|
||||||
getCmd.Flags().StringVarP(&downloadResolutionFlag,
|
downloadCmd.Flags().StringVarP(&downloadResolutionFlag,
|
||||||
"resolution",
|
"resolution",
|
||||||
"r",
|
"r",
|
||||||
"best",
|
"best",
|
||||||
|
|
@ -113,13 +113,13 @@ func init() {
|
||||||
"\tAvailable abbreviations: 1080p, 720p, 480p, 360p, 240p\n"+
|
"\tAvailable abbreviations: 1080p, 720p, 480p, 360p, 240p\n"+
|
||||||
"\tAvailable common-use words: best (best available resolution), worst (worst available resolution)")
|
"\tAvailable common-use words: best (best available resolution), worst (worst available resolution)")
|
||||||
|
|
||||||
getCmd.Flags().IntVarP(&downloadGoroutinesFlag,
|
downloadCmd.Flags().IntVarP(&downloadGoroutinesFlag,
|
||||||
"goroutines",
|
"goroutines",
|
||||||
"g",
|
"g",
|
||||||
runtime.NumCPU(),
|
runtime.NumCPU(),
|
||||||
"Sets how many parallel segment downloads should be used")
|
"Sets how many parallel segment downloads should be used")
|
||||||
|
|
||||||
rootCmd.AddCommand(getCmd)
|
rootCmd.AddCommand(downloadCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
func download(urls []string) error {
|
func download(urls []string) error {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue