Created
July 25, 2019 14:43
-
-
Save fabienhinault/dbc13ee82c31541acaff6f32952cc0d9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/usr/bin/env bash | |
| _docurl_completions() | |
| { | |
| IFS=" \t\n" | |
| # COMPREPLY=($(compgen -W "$(history | grep curl | sed "s/\$(\||\|)/\n/g" | grep curl | tail -n 100)" -- "${COMP_WORDS[$COMP_CWORD]}" | sort | uniq )) | |
| COMPREPLY=($(compgen -W "$(history | cut -d ' ' -f2- | grep curl | sed 's/\$(\||\|)/\n/g' | grep curl | tail -n 200 | tr " " "\n" | sort | uniq | cut -c -200 | tr "\n" " ")" -- "${COMP_WORDS[$COMP_CWORD]}")) | |
| } | |
| complete -F _docurl_completions curl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment