From 4a9b568f6c934e9a4fe1a18492bcab2c4628ea06 Mon Sep 17 00:00:00 2001 From: Evan Fiordeliso Date: Sat, 15 Apr 2023 18:07:48 -0400 Subject: [PATCH] Update README file and cobra descriptions --- README.md | 8 ++++---- cmd/root.go | 16 +++++++--------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 872c2f6..af30896 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,12 @@ ytdl-web [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) - -h, --help help for ytdl-web -- -l, --listen string address to listen on (default is 127.0.0.1) (default "127.0.0.1") -- -p, --port int port to listen on (default is 8080) (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") +- -l, --listen string address to listen on (default "127.0.0.1") +- -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 "yt-dlp") ## Building from source diff --git a/cmd/root.go b/cmd/root.go index 323842f..40826e1 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -20,12 +20,10 @@ var ( rootCmd = &cobra.Command{ Use: "ytdl-web", Short: "A web frontend for yt-dlp", - Long: `A longer description that spans multiple lines and likely contains -examples and usage of using your application. For example: + Long: `YTDL Web -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.`, +A web application that grabs the links to videos from over a +thousand websites using the yt-dlp project under the hood.`, Run: func(cmd *cobra.Command, args []string) { if err := web.Serve(); err != nil { 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().IntP("port", "p", 8080, "port to listen on (default is 8080)") - rootCmd.PersistentFlags().StringP("listen", "l", "127.0.0.1", "address to listen on (default is 127.0.0.1)") - rootCmd.PersistentFlags().StringP("base-path", "b", "", "the base path, used when behind reverse proxy (default is \"\")") - 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().IntP("port", "p", 8080, "port to listen on") + 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") + 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 viper.BindPFlag("port", rootCmd.PersistentFlags().Lookup("port"))