-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_gitignore_completions
141 lines (133 loc) · 8.41 KB
/
_gitignore_completions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!/usr/bin/env bash
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
##@Version : 202108121903-git
# @Author : Jason Hempstead
# @Contact : jason@casjaysdev.pro
# @License : WTFPL
# @ReadME : gitignore --help
# @Copyright : Copyright: (c) 2021 Jason Hempstead, Casjays Developments
# @Created : Thursday, Aug 12, 2021 19:03 EDT
# @File : gitignore
# @Description : Generate a .gitignore file
# @TODO : Make this work locally
# @Other :
# @Resource :
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -'
_gitignore() {
___findcmd() { find -L "${1:-$CONFDIR/}" -maxdepth ${3:-3} -type ${2:-f} 2>/dev/null | sed 's#'${1:-$CONFDIR}'##g' | grep '^' || return 1; }
local CASJAYSDEVDIR="${CASJAYSDEVDIR:-/usr/local/share/CasjaysDev/scripts}"
local cur prev words cword opts split
local cur="${COMP_WORDS[$COMP_CWORD]}"
local prev="${COMP_WORDS[$COMP_CWORD - 1]}"
local CONFFILE="settings.conf"
local CONFDIR="$HOME/.config/myscripts/gitignore"
local SEARCHDIR="${CONFDIR:-$HOME/.config/myscripts/gitignore}"
#local SEARCHCMD="$(___findcmd "$SEARCHDIR/" "d" "1" | sort -u)"
local SHOW_COMP_OPTS=""
local FILEDIR=""
local OPTS=""
local LONGOPTS="--options --config --version --help --dir"
local SHORTOPTS=""
local ARRAY="dirignore default "
local ARRAY+="1c 1c-bitrix a-frame actionscript ada adobe advancedinstaller adventuregamestudio agda al alteraquartusii altium amplify android androidstudio angular "
local ARRAY+="anjuta ansible apachecordova apachehadoop appbuilder appceleratortitanium appcode appcode+all appcode+iml appengine aptanastudio arcanist archive "
local ARRAY+="archives archlinuxpackages aspnetcore assembler ate atmelstudio ats audio automationstudio autotools autotools+strict awr backup ballerina basercms "
local ARRAY+="basic batch bazaar bazel bitrise bitrix bittorrent blackbox bloop bluej bookdown bower bricxcc buck c c++ cake cakephp cakephp2 cakephp3 calabash carthage "
local ARRAY+="certificates ceylon cfwheels chefcookbook chocolatey clean clion clion+all clion+iml clojure cloud9 cmake cocoapods cocos2dx cocoscreator code code-java "
local ARRAY+="codeblocks codecomposerstudio codeigniter codeio codekit codesniffer coffeescript commonlisp composer compressed compressedarchive compression concrete5 "
local ARRAY+="coq cordova craftcms crashlytics crbasic crossbar crystal csharp cuda cvs d dart darteditor data database datarecovery dbeaver defold delphi dframe diff "
local ARRAY+="direnv diskimage django dm docfx docpress docz dotenv dotfilessh dotnetcore dotsettings dreamweaver dropbox drupal drupal7 drupal8 e2studio eagle easybook "
local ARRAY+="eclipse eiffelstudio elasticbeanstalk elisp elixir elm emacs ember ensime episerver erlang espresso executable exercism expressionengine extjs fancy fastlane "
local ARRAY+="finale firebase flashbuilder flask flex flexbuilder floobits flutter font fontforge forcedotcom forgegradle fortran freepascal fsharp fuelphp fusetools games "
local ARRAY+="gcov genero4gl geth ggts gis git gitbook go godot goodsync gpg gradle grails greenfoot groovy grunt gwt haskell helm hexo hol homeassistant homebrew hsp hugo "
local ARRAY+="hyperledgercomposer iar iar_ewarm iarembeddedworkbench idapro idris igorpro images infer inforcms inforcrm intellij intellij+all intellij+iml ionic3 jabref "
local ARRAY+="java java-web jboss jboss-4-2-3-ga jboss-6-x jboss4 jboss6 jdeveloper jekyll jenv jetbrains jetbrains+all jetbrains+iml jgiven jigsaw jmeter joe joomla jspm "
local ARRAY+="julia jupyternotebooks justcode kate kdevelop4 kdiff3 keil kentico kicad kirby2 kobalt kohana komodoedit konyvisualizer kotlin labview labviewnxg lamp laravel "
local ARRAY+="latex lazarus leiningen lemonstand less liberosoc librarian-chef libreoffice lilypond linux lithium localstack logtalk lsspice ltspice lua lyx m2e macos magento "
local ARRAY+="magento1 magento2 magic-xpa matlab maven mavensmate mdbook mean mercurial mercury meson metals metaprogrammingsystem meteor meteorjs microsoftoffice mikroc moban "
local ARRAY+="modelsim modx momentics monodevelop mplabx mule nanoc nativescript ncrunch nesc netbeans nette nikola nim ninja node nodechakratimetraveldebug nohup notepadpp now "
local ARRAY+="nuxt nuxtjs nwjs objective-c ocaml octave octobercms opa opencart opencv openfoam openframeworks openframeworks+visualstudio oracleforms orcad osx otto oxideshop "
local ARRAY+="oxygenxmleditor packer particle patch pawn perl perl6 ph7cms phalcon phoenix phpcodesniffer phpstorm phpstorm+all phpstorm+iml phpunit pico8 pimcore pimcore4 pimcore5 "
local ARRAY+="pinegrow platformio playframework plone polymer powershell premake-gmake prepros prestashop processing progressabl psoccreator puppet puppet-librarian purebasic "
local ARRAY+="purescript putty pvs pycharm pycharm+all pycharm+iml pydev python qml qooxdoo qt qtcreator r racket rails react reactnative reasonml red redcar redis retool rhodesrhomobile "
local ARRAY+="rider root ros ruby rubymine rubymine+all rubymine+iml rust salesforce salesforcedx sas sass sbt scala scheme scons scrivener sdcc seamgen senchatouch serverless shopware "
local ARRAY+="silverstripe sketchup slickedit smalltalk snap snapcraft solidity soliditytruffle sonar sonarqube sourcepawn spark splunk spreadsheet ssh standardml stata stdlib stella "
local ARRAY+="stellar stylus sublimetext sugarcrm svn swift swiftpackagemanager swiftpm symfony symphonycms synology synopsysvcs tags tarmainstallmate terraform terragrunt test testcomplete "
local ARRAY+="testinfra tex text textmate textpattern theos-tweak thinkphp tla+ tortoisegit tower turbogears2 twincat3 typings typo3 typo3-composer umbraco unity unrealengine vaadin vagrant "
local ARRAY+="valgrind vapor venv vertx video vim virtualenv virtuoso visualstudio visualstudiocode vivado vlab vue vuejs vvvv waf wakanda web webmethods webstorm webstorm+all webstorm+iml "
local ARRAY+="werckercli windows wintersmith wordpress wyam xamarinstudio xcode xcodeinjection xilinx xilinxise xilinxvivado xill xojo xtext y86 yarn yeoman yii yii2 zendframework zephir "
local ARRAY+="zig zsh zukencr8000 "
_init_completion || return
if [[ "$SHOW_COMP_OPTS" != "" ]]; then
local SHOW_COMP_OPTS_SEP="${SHOW_COMP_OPTS//,/ }"
compopt -o $SHOW_COMP_OPTS_SEP
fi
if [[ ${cur} == --* ]]; then
COMPREPLY=($(compgen -W '${LONGOPTS}' -- ${cur}))
return
elif [[ ${cur} == -* ]]; then
COMPREPLY=($(compgen -W '${SHORTOPTS}' -- ${cur}))
return
else
case "${COMP_WORDS[1]:-$prev}" in
--options)
local prev="--options"
COMPREPLY=($(compgen -W '' -- "${cur}"))
;;
--config)
local prev="--config"
COMPREPLY=($(compgen -W '' -- "${cur}"))
;;
--help)
prev="--help"
COMPREPLY=($(compgen -W '' -- "${cur}"))
;;
--version)
local prev="--version"
COMPREPLY=($(compgen -W '' -- "${cur}"))
;;
--dir)
local prev="dir"
_filedir
return
;;
*)
if [[ -n "$FILEDIR" ]]; then _filedir; fi
if [[ "$ARRAY" = "show__none" ]]; then
COMPREPLY=($(compgen -W '' -- "${cur}"))
elif [[ "$ARRAY" = "show__filedir" ]]; then
_filedir
elif [[ "$ARRAY" = "show__commands" ]]; then
COMPREPLY=($(compgen -c -- "${cur}"))
elif [ "$ARRAY" != "" ]; then
COMPREPLY=($(compgen -W '${ARRAY}' -- "${cur}"))
elif [ -n "$OPTS" ]; then
COMPREPLY=($(compgen -W '${OPTS}' -- "${cur}"))
else
COMPREPLY=($(compgen -W '${ARRAY}' -- "${cur}"))
# elif [[ ${cword} -gt 2 ]]; then
# return
# elif [[ ${cword} == 2 ]]; then
# _filedir
# compopt -o nospace
# return
# elif [[ $cword -eq 1 ]]; then
# COMPREPLY=($(compgen -W '{a..z}{a..z}' -- "${cur}"))
# compopt -o nospace
# return
fi
;;
esac
fi
#
# [[ ${cword} == 2 ]] && _filedir && compopt -o nospace
# [[ $COMP_CWORD -eq 2 ] && COMPREPLY=($(compgen -W '{a..z} {A..Z} {0..9}' -o nospace -- "${cur}"))
# [[ $COMP_CWORD -eq 3 ] && COMPREPLY=($(compgen -W '$(_filedir)' -o filenames -o dirnames -- "${cur}"))
# [[ $COMP_CWORD -gt 3 ] && COMPREPLY=($(compgen -W '' -- "${cur}"))
#prev=""
#compopt -o nospace
$split && return
} &&
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# enable completions
complete -F _gitignore gitignore