Browse Source

Добавлены комментарии. Исправлены пути к файлам

Maxim Likhachev 12 years ago
parent
commit
ea19cf850b
  1. 70
      etc/shell/bash/bash_completion_cygwin

70
etc/shell/bash/bash_completion_cygwin

@ -1,55 +1,71 @@ @@ -1,55 +1,71 @@
#!/bin/bash ####################################################################
#
# Создан: Ср 14 авг 2013 12:07:22
# Изменён: Сб 24 авг 2013 12:15:37
# Изменён: Вт 27 авг 2013 12:41:23
#
################################################################################
# Дополнение команд ------------------------------------------------------------
complete -W "accounts computer config continue file \
group help helpmsg localgroup name pause print \
send session share start statistics stop time use user view" \
net
complete -W "boot config continue control create delete description \
enumdepend failure failureflag getdisplayname getkeyname \
interrogate lock pause qc qdescription qfailure query \
queryex querylock sdset sdshow start stop" \
sc
#Компоненты Панели управления Windows
complete -W 'access appwiz desk directx hdwwiz intl \
inetcpl joy mmsys ncpa netsetup odbccp32 \
powercfg timedate teltphon wuaucpl wscui' \
cpl
#Оснастки Windows
complete -W 'compmgmt gpedit dsa ciadv certmgr devmgmt \
dfrg diskmgmt eventvwr fsmgmt ntmsmgr ntmsoprq \
perfmon lusrmgr rsop services secpol wmimgmt' \
msc
_rdp () {
complete -W "boot config continue control create delete description \
enumdepend failure failureflag getdisplayname getkeyname \
interrogate lock pause qc qdescription qfailure query \
queryex querylock sdset sdshow start stop" \
sc
#Запуск сервисов
_sc_start() {
if [[ $2 == "" ]]; then
COMPREPLY=($(echo "cb\nts\nms\n$(qappsrv | tail -n +3 | tr ' ' ' ')"))
COMPREPLY=($(sc query type= service state= inactive | grep SERVICE_NAME | cut -d ':' -f 2- ))
else
COMPREPLY=($(echo "cb\nts\nms\n$(qappsrv | tail -n +3 | tr ' ' ' ')" | grep -i $2))
COMPREPLY=($(sc query type= service state= inactive | grep SERVICE_NAME | cut -d ':' -f 2- | grep $2 ))
fi
}
complete -F _rdp rdp
complete -F _sc_start sc_start
#Приостановление и остановка работы сервисов
_sc_set_status() {
if [[ $2 == "" ]]; then
COMPREPLY=($(sc query type= service state= all | grep SERVICE_NAME | cut -d ':' -f 2- ))
else
COMPREPLY=($(sc query type= service state= all | grep SERVICE_NAME | cut -d ':' -f 2- | grep $2 ))
fi
}
_wiki() {
wikidir=/cygdrive/z/wiki
complete -F _sc_set_status sc_stop sc_pause sc_continue
#Дополнение имён хостов --------------------------------------------------------
#Подключение по rdp
_rdp () {
if [[ $2 == "" ]]; then
COMPREPLY=($(\ls -1 ${wikidir}/*.html | sed 's/^.*\/\(.*\)\.html$/\1/'))
COMPREPLY=($(echo "cb\nts\nms\n$(qappsrv | tail -n +3 | tr ' ' ' ')"))
else
COMPREPLY=($(\ls -1 ${wikidir}/*.html | sed 's/^.*\/\(.*\)\.html$/\1/' | grep "^$2"))
COMPREPLY=($(echo "cb\nts\nms\n$(qappsrv | tail -n +3 | tr ' ' ' ')" | grep -i $2))
fi
}
complete -F _wiki wiki
complete -F _rdp rdp
#Подключение по vnc
_vnc() {
if [[ $2 == "" ]]; then
COMPREPLY=($(net view | grep -o '^\\\\[^[:space:]]*' | sed 's/^\\\\//'))
@ -61,23 +77,19 @@ _vnc() { @@ -61,23 +77,19 @@ _vnc() {
complete -F _vnc vnc
_sc_start() {
if [[ $2 == "" ]]; then
COMPREPLY=($(sc query type= service state= inactive | grep SERVICE_NAME | cut -d ':' -f 2- ))
else
COMPREPLY=($(sc query type= service state= inactive | grep SERVICE_NAME | cut -d ':' -f 2- | grep $2 ))
fi
}
#Прочее ------------------------------------------------------------------------
complete -F _sc_start sc_start
#Дополнение wiki-страниц.
#Рабочая wiki небольшая, все файлы расположены в корне директории
_wiki() {
wikidir="//file-srv/homedir$/$(whoami)/wiki/"
_sc_set_status() {
if [[ $2 == "" ]]; then
COMPREPLY=($(sc query type= service state= all | grep SERVICE_NAME | cut -d ':' -f 2- ))
COMPREPLY=($(\ls -1 ${wikidir}/*.html | sed 's/^.*\/\(.*\)\.html$/\1/'))
else
COMPREPLY=($(sc query type= service state= all | grep SERVICE_NAME | cut -d ':' -f 2- | grep $2 ))
COMPREPLY=($(\ls -1 ${wikidir}/*.html | sed 's/^.*\/\(.*\)\.html$/\1/' | grep "^$2"))
fi
}
complete -F _sc_set_status sc_stop sc_pause sc_continue
complete -F _wiki wiki

Loading…
Cancel
Save