mirror of
https://github.com/bit1001/tdl.git
synced 2024-12-25 22:24:25 +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{
|
||||
Use: "chat",
|
||||
Short: "A set of chat tools",
|
||||
Example: "",
|
||||
Example: "tdl chat -h",
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
|
@ -7,8 +7,8 @@ import (
|
|||
|
||||
var cmdList = &cobra.Command{
|
||||
Use: "ls",
|
||||
Short: "List your all chats with info",
|
||||
Example: "",
|
||||
Short: "List your chats",
|
||||
Example: "tdl chat ls -n iyear --proxy socks5://localhost:1080",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return chat.List(cmd.Context(), cmd.Flag("ns").Value.String(), cmd.Flag("proxy").Value.String())
|
||||
},
|
||||
|
|
|
@ -12,7 +12,7 @@ var (
|
|||
var cmdURL = &cobra.Command{
|
||||
Use: "url",
|
||||
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 {
|
||||
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{
|
||||
Use: "login",
|
||||
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 {
|
||||
return login.Run(cmd.Context(), cmd.Flag("ns").Value.String(), cmd.Flag("proxy").Value.String())
|
||||
},
|
||||
|
|
|
@ -20,7 +20,7 @@ import (
|
|||
|
||||
var cmd = &cobra.Command{
|
||||
Use: "tdl",
|
||||
Short: "Telegram downloader, but not only a downloader",
|
||||
Short: "Telegram Downloader, but more than a downloader",
|
||||
Example: "tdl -h",
|
||||
DisableAutoGenTag: true,
|
||||
SilenceErrors: true,
|
||||
|
|
|
@ -18,7 +18,7 @@ var Cmd = &cobra.Command{
|
|||
Use: "up",
|
||||
Aliases: []string{"upload"},
|
||||
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 {
|
||||
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(&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")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue