mirror of
https://github.com/bit1001/tdl.git
synced 2024-09-20 06:35:54 +08:00
feat(cmd): add examples
This commit is contained in:
parent
52ca0caf01
commit
52d44d1f0e
|
@ -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() {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue