Skip to content

Commit

Permalink
chore(cmd): remove example
Browse files Browse the repository at this point in the history
  • Loading branch information
iyear committed Sep 25, 2022
1 parent adf4edc commit 4850b5c
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 21 deletions.
5 changes: 2 additions & 3 deletions cmd/archive/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import (
var dst string

var CmdBackup = &cobra.Command{
Use: "backup",
Short: "Backup your data",
Example: "tdl backup -d tdl-backup-iyear.zip",
Use: "backup",
Short: "Backup your data",
RunE: func(cmd *cobra.Command, args []string) error {
if dst == "" {
dst = fmt.Sprintf("tdl-backup-%s.zip", time.Now().Format("2006-01-02-15_04_05"))
Expand Down
5 changes: 2 additions & 3 deletions cmd/archive/recover.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import (
var file string

var CmdRecover = &cobra.Command{
Use: "recover",
Short: "Recover your data",
Example: "tdl recover -f tdl-backup-iyear.zip",
Use: "recover",
Short: "Recover your data",
RunE: func(cmd *cobra.Command, args []string) error {
return archive.Recover(cmd.Context(), file)
},
Expand Down
5 changes: 2 additions & 3 deletions cmd/chat/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import (
)

var Cmd = &cobra.Command{
Use: "chat",
Short: "A set of chat tools",
Example: "tdl chat -h",
Use: "chat",
Short: "A set of chat tools",
}

func init() {
Expand Down
5 changes: 2 additions & 3 deletions cmd/chat/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import (
)

var cmdList = &cobra.Command{
Use: "ls",
Short: "List your chats",
Example: "tdl chat ls -n iyear --proxy socks5://localhost:1080",
Use: "ls",
Short: "List your chats",
RunE: func(cmd *cobra.Command, args []string) error {
return chat.List(cmd.Context())
},
Expand Down
1 change: 0 additions & 1 deletion cmd/dl/dl.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ var Cmd = &cobra.Command{
Use: "dl",
Aliases: []string{"download"},
Short: "Download anything from Telegram (protected) chat",
Example: "tdl dl -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 dl.Run(cmd.Context(), urls, files)
},
Expand Down
5 changes: 2 additions & 3 deletions cmd/login/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ var (
)

var Cmd = &cobra.Command{
Use: "login",
Short: "Login to Telegram",
Example: "tdl login -n iyear --proxy socks5://localhost:1080",
Use: "login",
Short: "Login to Telegram",
RunE: func(cmd *cobra.Command, args []string) error {
color.Yellow("WARN: If data exists in the namespace, data will be overwritten")

Expand Down
1 change: 0 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
var cmd = &cobra.Command{
Use: "tdl",
Short: "Telegram Downloader, but more than a downloader",
Example: "tdl -h",
DisableAutoGenTag: true,
SilenceErrors: true,
SilenceUsage: true,
Expand Down
1 change: 0 additions & 1 deletion cmd/up/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ var Cmd = &cobra.Command{
Use: "up",
Aliases: []string{"upload"},
Short: "Upload anything to Telegram",
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(), paths, excludes)
},
Expand Down
5 changes: 2 additions & 3 deletions cmd/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ import (
var version string

var Cmd = &cobra.Command{
Use: "version",
Short: "Check the version info",
Example: "tdl version",
Use: "version",
Short: "Check the version info",
Run: func(cmd *cobra.Command, args []string) {
buf := &bytes.Buffer{}
_ = template.Must(template.New("version").Parse(version)).Execute(buf, map[string]interface{}{
Expand Down

0 comments on commit 4850b5c

Please sign in to comment.