Skip to content
Snippets Groups Projects
Commit 7c1da359 authored by Grant Miller's avatar Grant Miller
Browse files

Remove old Zsh completion script

parent 9b5eebfb
No related branches found
No related tags found
No related merge requests found
#!zsh
# Installation:
#
# Copy this file to ~/.zsh/ (create it, if it doesn't exist, or put it
# somewhere that makes sense to you). Then, insert the following line
# in your ~/.zshrc (making sure to use the right folder name, if changed):
#
# source ~/.zsh/pmbootstrap-autocompletion.zsh
#
# Then, set the variable PMBOOTSTRAP_DIR to your `pmbootstrap` root.
# Example:
#
# PMBOOTSTRAP_DIR=/home/axel/Git/pmbootstrap
#
# This file is rudimentary, pmbootstrap actions and packages are autocompleted
# so far. Further ideas for improvements are here:
# <https://github.com/postmarketOS/pmbootstrap/pull/1232>
PMBOOTSTRAP_DIR=
_pmbootstrap_commands()
{
grep '^def ' $PMBOOTSTRAP_DIR/pmb/helpers/frontend.py | cut -d ' ' -f 2 \
| cut -d '(' -f 1 | grep -v '^_'
}
_pmbootstrap_targets()
{
case $1 in
build|checksum|pkgrel_bump)
find $PMBOOTSTRAP_DIR/aports/ -mindepth 2 -maxdepth 2 -type d \
-printf '%f\n' | sed "s|$PMBOOTSTRAP_DIR/aports/||g"
;;
kconfig)
echo edit check
;;
flasher)
echo boot flash_kernel flash_rootfs sideload list_flavors \
list_devices
;;
esac
}
_pmbootstrap()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
'1: :->command'\
'2: :->target'
case $state in
command)
compadd `_pmbootstrap_commands`
;;
target)
compadd `_pmbootstrap_targets $line[1]`
;;
esac
}
if [ -f $PMBOOTSTRAP_DIR/pmbootstrap.py ]; then
compdef _pmbootstrap pmbootstrap
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment