Skip to content

Commit

Permalink
Add make_cli_docs script
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasdabbas committed Apr 15, 2022
1 parent 7581b99 commit 90019d7
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions _make_cli_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

advertools --help > adv_help

adv_commands=$(sed -n '/{.*}/p' adv_help | head -n 1 | sed 's/,/ /g' | sed 's/[}{]//g')

for command in $adv_commands
do

advertools $command --help > $command.txt

echo
title=$(cat $command.txt | sed '1,/^$/d' | head -n 1)
title_len=$(echo $title | wc -c)

echo $title
for i in $(seq 1 $title_len); do printf = ; done
echo
echo
echo

cat $command.txt | sed '/══/d' | sed '/full documentation at.*/d' | sed 's/^/ /' | sed -E 's/^\s+$//'

rm $command.txt

done

# dns () { for line in $(cat $1); do host $line >> $2 ; done }
# columns () { head -n 1 $1 | sed 's/,/\n/g' | cat -n; }

0 comments on commit 90019d7

Please sign in to comment.