mirror of
https://github.com/bit1001/tdl.git
synced 2025-10-30 00:36:06 +08:00
chore(cmd): examples and desc
This commit is contained in:
parent
e1e4ae4986
commit
b935ae7737
6 changed files with 8 additions and 8 deletions
|
|
@ -7,7 +7,7 @@ import (
|
||||||
var Cmd = &cobra.Command{
|
var Cmd = &cobra.Command{
|
||||||
Use: "chat",
|
Use: "chat",
|
||||||
Short: "A set of chat tools",
|
Short: "A set of chat tools",
|
||||||
Example: "",
|
Example: "tdl chat -h",
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ import (
|
||||||
|
|
||||||
var cmdList = &cobra.Command{
|
var cmdList = &cobra.Command{
|
||||||
Use: "ls",
|
Use: "ls",
|
||||||
Short: "List your all chats with info",
|
Short: "List your chats",
|
||||||
Example: "",
|
Example: "tdl chat ls -n iyear --proxy socks5://localhost:1080",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
return chat.List(cmd.Context(), cmd.Flag("ns").Value.String(), cmd.Flag("proxy").Value.String())
|
return chat.List(cmd.Context(), cmd.Flag("ns").Value.String(), cmd.Flag("proxy").Value.String())
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ var (
|
||||||
var cmdURL = &cobra.Command{
|
var cmdURL = &cobra.Command{
|
||||||
Use: "url",
|
Use: "url",
|
||||||
Short: "Download in url mode",
|
Short: "Download in url mode",
|
||||||
Example: "tdl dl url -n iyear --proxy socks5://127.0.0.1:1080 -u https://t.me/tdl/1 -u https://t.me/tdl/2 -s 262144 -t 16 -l 3",
|
Example: "tdl dl url -n iyear --proxy socks5://localhost:1080 -u https://t.me/tdl/1 -u https://t.me/tdl/2 -s 262144 -t 16 -l 3",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
return dlurl.Run(cmd.Context(), cmd.Flag("ns").Value.String(), cmd.Flag("proxy").Value.String(), partSize, threads, limit, urls)
|
return dlurl.Run(cmd.Context(), cmd.Flag("ns").Value.String(), cmd.Flag("proxy").Value.String(), partSize, threads, limit, urls)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import (
|
||||||
var Cmd = &cobra.Command{
|
var Cmd = &cobra.Command{
|
||||||
Use: "login",
|
Use: "login",
|
||||||
Short: "Login to Telegram",
|
Short: "Login to Telegram",
|
||||||
Example: "tdl login -n my-tdl --proxy socks5://localhost:1080",
|
Example: "tdl login -n iyear --proxy socks5://localhost:1080",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
return login.Run(cmd.Context(), cmd.Flag("ns").Value.String(), cmd.Flag("proxy").Value.String())
|
return login.Run(cmd.Context(), cmd.Flag("ns").Value.String(), cmd.Flag("proxy").Value.String())
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import (
|
||||||
|
|
||||||
var cmd = &cobra.Command{
|
var cmd = &cobra.Command{
|
||||||
Use: "tdl",
|
Use: "tdl",
|
||||||
Short: "Telegram downloader, but not only a downloader",
|
Short: "Telegram Downloader, but more than a downloader",
|
||||||
Example: "tdl -h",
|
Example: "tdl -h",
|
||||||
DisableAutoGenTag: true,
|
DisableAutoGenTag: true,
|
||||||
SilenceErrors: true,
|
SilenceErrors: true,
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ var Cmd = &cobra.Command{
|
||||||
Use: "up",
|
Use: "up",
|
||||||
Aliases: []string{"upload"},
|
Aliases: []string{"upload"},
|
||||||
Short: "Upload anything to Telegram",
|
Short: "Upload anything to Telegram",
|
||||||
Example: "tdl up -h",
|
Example: "tdl up -n iyear --proxy socks5://localhost:1080 -p /path/to/file -p /path -e .so -e .tmp -s 262144 -t 16 -l 3",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
return up.Run(cmd.Context(), cmd.Flag("ns").Value.String(), cmd.Flag("proxy").Value.String(), partSize, threads, limit, paths, excludes)
|
return up.Run(cmd.Context(), cmd.Flag("ns").Value.String(), cmd.Flag("proxy").Value.String(), partSize, threads, limit, paths, excludes)
|
||||||
},
|
},
|
||||||
|
|
@ -29,6 +29,6 @@ func init() {
|
||||||
Cmd.PersistentFlags().IntVarP(&threads, "threads", "t", 8, "threads for uploading one item")
|
Cmd.PersistentFlags().IntVarP(&threads, "threads", "t", 8, "threads for uploading one item")
|
||||||
Cmd.PersistentFlags().IntVarP(&limit, "limit", "l", 2, "max number of concurrent tasks")
|
Cmd.PersistentFlags().IntVarP(&limit, "limit", "l", 2, "max number of concurrent tasks")
|
||||||
|
|
||||||
Cmd.Flags().StringSliceVarP(&paths, "path", "p", []string{}, "it can be dirs or files")
|
Cmd.Flags().StringSliceVarP(&paths, "path", "p", []string{}, "dirs or files")
|
||||||
Cmd.Flags().StringSliceVarP(&excludes, "excludes", "e", []string{}, "exclude the specified file extensions")
|
Cmd.Flags().StringSliceVarP(&excludes, "excludes", "e", []string{}, "exclude the specified file extensions")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue