diff options
author | Euro20179 <f> | 2021-03-02 14:52:53 -0800 |
---|---|---|
committer | Euro20179 <f> | 2021-03-02 14:52:53 -0800 |
commit | 7b3af8443d8a68b2e8c432d77bc27fab8389eb25 (patch) | |
tree | d96d900ec8040fd4d85186b1e42198c259d34ae3 | |
parent | 565e37ff22d6a1893d431e0b51f52bf7310c12cb (diff) | |
download | ytfzf-7b3af8443d8a68b2e8c432d77bc27fab8389eb25.tar.gz |
better help, commenting
-rw-r--r-- | README.md | 32 | ||||
-rwxr-xr-x | ytfzf | 6 |
2 files changed, 20 insertions, 18 deletions
@@ -28,22 +28,22 @@ Initially this used to be a single line script. But for portability and extensib ``` Usage: ytfzf <search query> - -h Show this help text - -t Show thumbnails (requires ueberzug) - Doesn't work with -H -D - -D Use external menu(default dmenu) instead of fzf - -H Choose from history - -x Delete history - -m <search query> Audio only (for music) - -d <search query> Download to current directory - -f <search query> Show available formats before proceeding - -a <search query> Auto play the first result, no selector - -r <search query> Auto play a random result, no selector - -n <link count> To specify number of videos to select with -a or -r - -l <search query> Loop: prompt selector again after video ends - -s <search query> After the video ends make another search - -L <search query> Prints the selected URL only, helpful for scripting - Use - instead of <query> for stdin + -h, --help Show this help text + -t, --thumbnails Show thumbnails (requires ueberzug) + Doesn't work with -H -D + -D, --ext-menu Use external menu(default dmenu) instead of fzf + -H, --choose-from-history Choose from history + -x, --clear-history Delete history + -m, --audio-only <search-query> Audio only (for music) + -d, --download <search-query> Download to current directory + -f <search-query> Show available formats before proceeding + -a, --auto-play <search-query> Auto play the first result, no selector + -r --random-play <search-query> Auto play a random result, no selector + -n, --link-count= <link-count> To specify number of videos to select with -a or -r + -l, --loop <search-query> Loop: prompt selector again after video ends + -s <search-query> After the video ends make another search + -L, --link-only <search-query> Prints the selected URL only, helpful for scripting + Use - instead of <search-query> for stdin ``` * To use dmenu with a custom width @@ -56,7 +56,7 @@ printf " -d, --download <search-query> Download to current directory\ printf " -f <search-query> Show available formats before proceeding\n"; printf " -a, --auto-play <search-query> Auto play the first result, no selector\n"; printf " -r --random-play <search-query> Auto play a random result, no selector\n"; -printf " -n, --link-count= <link-count> To specify number of videos to select with -a or -r\n"; +printf " -n, --link-count= <link-count> To specify number of videos to select with -a or -r\n"; printf " -l, --loop <search-query> Loop: prompt selector again after video ends\n"; printf " -s <search-query> After the video ends make another search \n"; printf " -L, --link-only <search-query> Prints the selected URL only, helpful for scripting\n"; @@ -414,13 +414,15 @@ show_format=0 link_count=1 #OPT - parse_opt () { + #the first arg is the option opt=$1 + #second arg is the optarg defaults to empty OPTARG="${2-}" case ${opt} in #Long options -) + #if the option has a short version it calls this function with the opt as the shortopt case "${OPTARG}" in help) parse_opt "h" ;; |