"Fossies" - the Fresh Open Source Software Archive

Member "gdrive-2.1.1/_release/print_usage_markdown.sh" (28 May 2021, 388 Bytes) of package /linux/misc/old/gdrive-2.1.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 
    3 echo '## Usage'
    4 echo '```'
    5 gdrive help | tail -n+3
    6 echo '```'
    7 
    8 IFS=$'\n'
    9 
   10 help=$(gdrive help | grep global | sed -E 's/ \[[^]]+\]//g' | sed -E 's/ <[^>]+>//g' | sed -E 's/ {2,}.+//' | sed -E 's/^gdrive //')
   11 
   12 for args in $help; do
   13     cmd="gdrive help $args"
   14     echo
   15     eval $cmd | sed -e '1s/^/#### /' | sed -e $'1s/$/\\\n```/' | sed -e 's/pii/<user>/'
   16     echo '```'
   17 done