Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
246 views
in Technique[技术] by (71.8m points)

command line interface - How to grep --help to find the section?

I know I worded my question in a confusing way, let me explain. My doubt is regarding using grep to find the info from --help instead of scrolling through. I want to find the section/chapter instead of just the mention. I am using youtube-dl for the example. I am looking to efficiently use the CLI for reading through the documentation.

When I run:

$ youtube-dl --help | grep -e "--extract-audio"
-x, --extract-audio              Convert video files to audio-only files

But when I look in the youtube-dll --help, there is more relevant info that I need:

-x, --extract-audio              Convert video files to audio-only files
                                     (requires ffmpeg or avconv and ffprobe or
                                     avprobe)
    --audio-format FORMAT            Specify audio format: "best", "aac",
                                     "flac", "mp3", "m4a", "opus", "vorbis", or
                                     "wav"; "best" by default; No effect without
                                     -x
    --audio-quality QUALITY          Specify ffmpeg/avconv audio quality, insert
                                     a value between 0 (better) and 9 (worse)
                                     for VBR or a specific bitrate like 128K
                                     (default 5)
    --recode-video FORMAT            Encode the video to another format if
                                     necessary (currently supported:
                                     mp4|flv|ogg|webm|mkv|avi)
    --postprocessor-args ARGS        Give these arguments to the postprocessor

So, my question is how to grep or if there is some other better tool, to find the info. As "-x" is the function I am looking for, but I would like to what all modifiers (--) I have to use.

question from:https://stackoverflow.com/questions/65913322/how-to-grep-help-to-find-the-section

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...