Advanced Command Line
Here are some advanced command line improvements for gitignore.io
@git2samus
this allows invocations as the previous but also permits passing arguments to curl like: gi --proxy somewhere:8080 -- linux python
function gi() (
gi_args=()
for arg; do
if [[ $arg = -- ]]; then
curl_args=("${gi_args[@]}")
gi_args=()
else
gi_args+=("$arg")
fi
done
IFS=,
curl "${curl_args[@]}" https://www.toptal.com/developers/gitignore/api/"${gi_args[*]}"
)@git2samus
Adds a check to see if curl or wget is installed.
if hash curl; then
curl "${curl_args[@]}" https://www.toptal.com/developers/gitignore/api/"${gi_args[*]}"
elif hash wget; then
wget -O- "${curl_args[@]}" https://www.toptal.com/developers/gitignore/api/"${gi_args[*]}"
else
echo "please install curl or wget to run this command" >&2
exit 1
fi@GeorgeErickson
Bash one-liner
@SantoshSrinivas79
Create a file for the function using vim ~/.config/fish/functions/gi.fish and enter the below code
oh-my-zsh
Provides completion for zsh
@zubin
Provides completion for fish
@Phoenix09
Improved git alias tee to .gitignore and accept multiple parameters
Last updated
Was this helpful?