Skip to content

Commit

Permalink
First public commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Honestpuck committed May 21, 2017
0 parents commit fd5c762
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 0 deletions.
6 changes: 6 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Copyright 2017 Tony Williams ([email protected])

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## bash completion for Apple tools

These are a number of scripts designed to add programmable completion to `bash` for
some of the command line tools
They complete the options for each tool, the completion cuts in after `-` or `--`.

If you have installed bash completion using `brew` then drop the files
into `/usr/local/etc/bash_completion.d/` (or link them) and open a new Terminal window.

Feedback, bug reports and comments would be greatly appreciated.
23 changes: 23 additions & 0 deletions dscl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Bash completion for dscl
# by Tony Williams, [email protected]
# version 0.2
# 18/05/2017

_dscl() {
local cur opts
COMPREPLY=()

cur="${COMP_WORDS[COMP_CWORD]}"
opts="-P -append -auth -authonly -cd -change -changei -create -createpl \
-createpli -delete -deletepl -deletepli -diff -f -list -merge -p -passwd \
-plist -popd -pushd -raw -read -readall -readpl -readpli -search -u"

case "$cur" in
-*)
COMPREPLY=($(compgen -W "$opts" - "$cur"))
return
;;
esac
}

complete -o bashdefault -o default -F _dscl dscl
23 changes: 23 additions & 0 deletions dsimport
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Bash completion for dsimport
# by Tony Williams, [email protected]
# version 0.2
# 18/05/2017

_dsimport() {
local cur opts
COMPREPLY=()

cur="${COMP_WORDS[COMP_CWORD]}"
opts="--crypt --force --groupid --grouppreset --help --loglevel --outputfile --password --\
--recordformat --recordtype --remotehost --remotepassword --remoteusername --startid
--template --username --userpreset --version"

case "$cur" in
--*)
COMPREPLY=($(compgen -W "$opts" -- "$cur"))
return
;;
esac
}

complete -o bashdefault -o default -F _dsimport dsimport
24 changes: 24 additions & 0 deletions installer
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Bash completion for installer
# by Tony Williams, [email protected]
# version 0.2
# 18/05/2017

_installer() {
local cur opts
COMPREPLY=()

cur="${COMP_WORDS[COMP_CWORD]}"
opts="-allowUntrusted -applyChoiceChangesXML -config -dominfo -dumplog -file -help -lang \
-listiso -pkg -installer -plist -query -showChoiceChangesXML \
-showChoicesAfterApplyingChangesXML -showChoicesXML -store -target \
-verbose -verboseR -vers -volinfo"

case "$cur" in
-*)
COMPREPLY=($(compgen -W "$opts" -- "$cur"))
return
;;
esac
}

complete -o bashdefault -o default -F _installer installer
23 changes: 23 additions & 0 deletions pkgbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Bash completion for pkgbuild
# by Tony Williams, [email protected]
# version 0.2
# 18/05/2017

_pkgbuild() {
local cur opts
COMPREPLY=()

cur="${COMP_WORDS[COMP_CWORD]}"
opts="--analyze --cert --component --component-plist --filter --identifier \
--install-location --keychain --nopayload --ownership --prior --quiet --root \
--scripts --sign --timestamp --timestamp=none --version"

case "$cur" in
--*)
COMPREPLY=($(compgen -W "$opts" "$cur"))
return
;;
esac
}

complete -o bashdefault -o default -F _pkgbuild pkgbuild
25 changes: 25 additions & 0 deletions pkginfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Bash completion for pkginfo
# by Tony Williams, [email protected]
# version 0.2
# 18/05/2017

_pkginfo() {
local cur opts
COMPREPLY=()

cur="${COMP_WORDS[COMP_CWORD]}"
opts="--bom --check-signature --edit-pkg --expand --export-plist --file-info \
--file-info-plist --files --flatten --force --forget --groups --groups-pkgs \
--groups-plist --help --learn --only-dirs --only-files --packages --payload-files \
--pkg-groups --pkg-info --pkg-info-plist --pkgs-plist --pkgs= --regexp --repair
--verbose --verify --volume"

case "$cur" in
--*)
COMPREPLY=($(compgen -W "$opts" "$cur"))
return
;;
esac
}

complete -o bashdefault -o default -F _pkginfo pkginfo
24 changes: 24 additions & 0 deletions pkgutil
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Bash completion for pkgutil
# by Tony Williams, [email protected]
# version 0.1
# 19/05/2017

_pkgutil() {
local cur opts
COMPREPLY=()

cur="${COMP_WORDS[COMP_CWORD]}"
opts="--bom --check-signature --edit-pkg --expand --export-plist --file-info \
--file-info-plist --files --flatten --force --forget --group-pkgs --groups-plist \
--help --learn --only-dirs --only-files --payload-files --pkg-groups --pkg-info \
--pkg-info-plist --pkgs --pkgs-plist --regexp --repair --verbose --verify --volume"

case "$cur" in
--*)
COMPREPLY=($(compgen -W "$opts" -- "$cur"))
return
;;
esac
}

complete -o bashdefault -o default -F _pkgutil pkgutil

0 comments on commit fd5c762

Please sign in to comment.