feat(cmd): add examples

This commit is contained in:
iyear 2022-09-10 15:20:16 +08:00
parent 52ca0caf01
commit 52d44d1f0e
3 changed files with 3 additions and 3 deletions

View file

@ -14,7 +14,7 @@ var CmdDL = &cobra.Command{
Use: "dl", Use: "dl",
Aliases: []string{"download"}, Aliases: []string{"download"},
Short: "Download what you want", Short: "Download what you want",
Example: "", Example: "tdl dl -h",
} }
func init() { func init() {

View file

@ -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: "", 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",
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
proxy, err := cmd.Flags().GetString("proxy") proxy, err := cmd.Flags().GetString("proxy")
if err != nil { if err != nil {

View file

@ -9,7 +9,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", Example: "tdl login -n my-tdl --proxy socks5://localhost:1080",
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
proxy, err := cmd.Flags().GetString("proxy") proxy, err := cmd.Flags().GetString("proxy")
if err != nil { if err != nil {