Update README file and cobra descriptions

This commit is contained in:
Evan Fiordeliso 2023-04-15 18:07:48 -04:00
parent ababeaacf8
commit 4a9b568f6c
2 changed files with 11 additions and 13 deletions

View File

@ -8,12 +8,12 @@ ytdl-web [OPTIONS]
Available options: Available options:
- -b, --base-path string the base path, used when behind reverse proxy (default is "") - -b, --base-path string the base path, used when behind reverse proxy
- --config string config file (default is $XDG_CONFIG_HOME/ytdl-web/config.yml) - --config string config file (default is $XDG_CONFIG_HOME/ytdl-web/config.yml)
- -h, --help help for ytdl-web - -h, --help help for ytdl-web
- -l, --listen string address to listen on (default is 127.0.0.1) (default "127.0.0.1") - -l, --listen string address to listen on (default "127.0.0.1")
- -p, --port int port to listen on (default is 8080) (default 8080) - -p, --port int port to listen on (default 8080)
- -y, --ytdlp-path string the path to the yt-dlp binary, used when it is not in $PATH (default is yt-dlp) (default "yt-dlp") - -y, --ytdlp-path string the path to the yt-dlp binary, used when it is not in $PATH (default "yt-dlp")
## Building from source ## Building from source

View File

@ -20,12 +20,10 @@ var (
rootCmd = &cobra.Command{ rootCmd = &cobra.Command{
Use: "ytdl-web", Use: "ytdl-web",
Short: "A web frontend for yt-dlp", Short: "A web frontend for yt-dlp",
Long: `A longer description that spans multiple lines and likely contains Long: `YTDL Web
examples and usage of using your application. For example:
Cobra is a CLI library for Go that empowers applications. A web application that grabs the links to videos from over a
This application is a tool to generate the needed files thousand websites using the yt-dlp project under the hood.`,
to quickly create a Cobra application.`,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
if err := web.Serve(); err != nil { if err := web.Serve(); err != nil {
slog.Error("Error when serving website", slog.String("error", err.Error())) slog.Error("Error when serving website", slog.String("error", err.Error()))
@ -46,10 +44,10 @@ func init() {
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $XDG_CONFIG_HOME/ytdl-web/config.yml)") rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $XDG_CONFIG_HOME/ytdl-web/config.yml)")
rootCmd.PersistentFlags().IntP("port", "p", 8080, "port to listen on (default is 8080)") rootCmd.PersistentFlags().IntP("port", "p", 8080, "port to listen on")
rootCmd.PersistentFlags().StringP("listen", "l", "127.0.0.1", "address to listen on (default is 127.0.0.1)") rootCmd.PersistentFlags().StringP("listen", "l", "127.0.0.1", "address to listen on")
rootCmd.PersistentFlags().StringP("base-path", "b", "", "the base path, used when behind reverse proxy (default is \"\")") rootCmd.PersistentFlags().StringP("base-path", "b", "", "the base path, used when behind reverse proxy")
rootCmd.PersistentFlags().StringP("ytdlp-path", "y", "yt-dlp", "the path to the yt-dlp binary, used when it is not in $PATH (default is yt-dlp)") rootCmd.PersistentFlags().StringP("ytdlp-path", "y", "yt-dlp", "the path to the yt-dlp binary, used when it is not in $PATH")
// trunk-ignore-begin(golangci-lint/errcheck): Ignoring errors // trunk-ignore-begin(golangci-lint/errcheck): Ignoring errors
viper.BindPFlag("port", rootCmd.PersistentFlags().Lookup("port")) viper.BindPFlag("port", rootCmd.PersistentFlags().Lookup("port"))