diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2022-11-16 14:35:05 +0200 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2022-11-16 20:08:28 +0200 |
commit | 27dd5ec2b8ca977e0b9711eca0d6cba543743a4e (patch) | |
tree | c35b3f648ca6cdb1473f02a5b837a654e81b1f7f /data/share | |
parent | commit: mention `-e` as nice option (diff) | |
download | pkgdev-27dd5ec2b8ca977e0b9711eca0d6cba543743a4e.tar.gz pkgdev-27dd5ec2b8ca977e0b9711eca0d6cba543743a4e.tar.bz2 pkgdev-27dd5ec2b8ca977e0b9711eca0d6cba543743a4e.zip |
build backend: use custom wrapper around flit
For pkgcore we need to run multiple preparations of generating files
before creating sdist or wheel. Flit is a very simple and nice build
backend, much more than setuptools.
Also migrate to use snakeoil.dist sphinx extension for generating man
and html, to remove various logic from `doc/conf.py`.
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'data/share')
-rw-r--r-- | data/share/bash-completion/completions/pkgdev | 200 | ||||
-rw-r--r-- | data/share/zsh/site-functions/_pkgdev | 104 |
2 files changed, 304 insertions, 0 deletions
diff --git a/data/share/bash-completion/completions/pkgdev b/data/share/bash-completion/completions/pkgdev new file mode 100644 index 0000000..1408292 --- /dev/null +++ b/data/share/bash-completion/completions/pkgdev @@ -0,0 +1,200 @@ +# bash completion for pkgdev + +source "/usr/share/bash-completion/helpers/gentoo-common.sh" + +_pkgdev() { + local i=1 cmd cur prev words cword split + _init_completion || return + + local subcommands=" + commit + manifest + mask + push + showkw + " + + local base_options=" + -h --help + --version + --debug + -q --quiet + -v --verbose + --color + " + + local boolean_options=" + true + false + " + + _list_repo_atoms() { + builtin cd "$(git rev-parse --show-toplevel)" || return + if [[ $cur == */* ]]; then + compgen -W "$(compgen -G "${cur}*" )" -- "${cur}" + else + compgen -W "$(compgen -G "${cur}*" -S / )" -- "${cur}" + fi + } + + if [[ ${prev} = "--color" ]]; then + COMPREPLY=($(compgen -W "${boolean_options}" -- "${cur}")) + return + fi + COMPREPLY=($(compgen -W "${base_options}" -- "${cur}")) + + # find the subcommand + while [[ "${i}" -lt "${COMP_CWORD}" ]]; do + local s="${COMP_WORDS[i]}" + case "${s}" in + -*) ;; + *) + cmd="${s}" + break + ;; + esac + ((i++)) + done + + if [[ "${i}" -eq "${COMP_CWORD}" ]]; then + COMPREPLY+=($(compgen -W "${subcommands}" -- "${cur}")) + return + fi + + local subcmd_options + case "${cmd}" in + commit) + subcmd_options=" + -b --bug + -c --closes + -T --tag + -n --dry-run + -s --scan + -A --ask + --mangle + --signoff + -m --message + -M --message-template + -e --edit + -u --update + -a --all + " + + case "${prev}" in + -[bcTm] | --bug | --closes | --tag | --message) + COMPREPLY=() + ;; + -M | --message-template) + COMPREPLY=($(compgen -f -- "${cur}")) + ;; + -s | --scan | --mangle) + COMPREPLY=($(compgen -W "${boolean_options}" -- "${cur}")) + ;; + *) + COMPREPLY+=($(compgen -W "${subcmd_options}" -- "${cur}")) + ;; + esac + ;; + manifest) + subcmd_options=" + -f --force + -m --mirrors + -d --distdir + --if-modified + " + + case "${prev}" in + -d | --distdir) + COMPREPLY=($(compgen -d -- "${cur}")) + ;; + *) + COMPREPLY+=($(compgen -W "${subcmd_options}" -- "${cur}")) + COMPREPLY+=($(_list_repo_atoms)) + ;; + esac + ;; + mask) + subcmd_options=" + -r --rites + -b --bugs + --email + " + + case "${prev}" in + -[rb] | --rites | --bugs) + COMPREPLY=() + ;; + *) + COMPREPLY+=($(compgen -W "${subcmd_options}" -- "${cur}")) + COMPREPLY+=($(_list_repo_atoms)) + ;; + esac + ;; + push) + subcmd_options=" + -A --ask + -n --dry-run + " + + COMPREPLY+=($(compgen -W "${subcmd_options}" -- "${cur}")) + ;; + showkw) + subcmd_options=" + -f --format + -c --collapse + -s --stable + -u --unstable + -o --only-unstable + -p --prefix + -a --arch + -r --repo + " + + case "${prev}" in + -f | --format) + format_options=" + fancy_grid + fancy_outline + github + grid + html + jira + latex + latex_booktabs + latex_longtable + latex_raw + mediawiki + moinmoin + orgtbl + pipe + plain + presto + pretty + psql + rst + showkw + simple + textile + tsv + unsafehtml + youtrack + " + COMPREPLY=($(compgen -W "${format_options}" -- "${cur}")) + ;; + -r | --repo) + COMPREPLY=($(compgen -W "$(_parsereposconf -l)" -- "${cur}")) + ;; + -a | --arch) + COMPREPLY=() + ;; + *) + COMPREPLY+=($(compgen -W "${subcmd_options}" -- "${cur}")) + COMPREPLY+=($(_list_repo_atoms)) + ;; + esac + ;; + esac +} +complete -F _pkgdev pkgdev + +# vim: set ft=bash sw=4 et sts=4 : diff --git a/data/share/zsh/site-functions/_pkgdev b/data/share/zsh/site-functions/_pkgdev new file mode 100644 index 0000000..f2c95bc --- /dev/null +++ b/data/share/zsh/site-functions/_pkgdev @@ -0,0 +1,104 @@ +#compdef pkgdev + +typeset -a base_options +local curcontext=$curcontext state state_descr line ret=1 + +base_options=( + '(- :)'{-h,--help}'[show help information and exit]' + '(- :)'--version'[show version information and exit]' + '(--debug --help -h)--debug[enable debugging output]' + '(--quiet -q --verbose -v)'{-q,--quiet}'[suppress non-error output]' + '(--verbose -v --quiet -q)'{-v,--verbose}'[show verbose output]' + "--color[Color output]:yes/no:((y\:'yes' n\:'no'))" +) + +_arguments -C \ + $base_options \ + '(-): :->command' \ + '(-)*:: :->subcommand' \ + && ret=0 + +case $state in + (command) + typeset -a subcommands + + subcommands=( + commit:'create git commit' + manifest:'update package manifests' + mask:'mask packages' + push:'run QA checks on commits and push them' + showkw:'show package keywords' + ) + + _describe -t subcommands subcommand subcommands && ret=0 + + ;; + (subcommand) + curcontext=${curcontext%:*}-$line[1]: + + case $line[1] in + (commit) + _arguments -C -A '-*' \ + $base_options \ + {'(--bug)-b','(-b)--bug'}'[add Bug tag for a given Gentoo or upstream bug]:bug ID or URL' \ + {'(--closes)-c','(-c)--closes'}'[add Closes tag for a given Gentoo bug or upstream PR URL]:bug ID or URL' \ + {'(--tag)-T','(-T)--tag'}'[add commit tag]:tag\:value' \ + {'(--dry-run)-n','(-n)--dry-run'}'[pretend to create commit]' \ + {'(--scan)-s','(-s)--scan'}'[run pkgcheck against staged changes]' \ + {'(--ask)-A','(-A)--ask'}'[confirm creating commit with QA errors]' \ + '--mangle[forcibly enable/disable file mangling]' \ + '--signoff[add a Signed-off-by trailer]' \ + \*{--message,-m}'[specify commit message]:message' \ + {'(--message-template)-M','(-M)--message-template'}'[use commit message template from specified file]:template:_files' \ + {'(--edit)-e','(-e)--edit'}'[force edit of commit]' \ + {'(--update)-u','(-u)--update'}'[stage all changed files]' \ + {'(--all)-a','(-a)--all'}'[stage all changed/new/removed files]' \ + && ret=0 + ;; + (manifest) + _arguments -C -A '-*' \ + $base_options \ + {'(--distdir)-d','(-d)--distdir'}'[target download directory]:distdir:_files -/' \ + {'(--force)-f','(-f)--force'}'[forcibly remanifest packages]' \ + {'(--mirrors)-m','(-m)--mirrors'}'[enable fetching from Gentoo mirrors]' \ + '--if-modified[only check packages that have uncommitted modifications]' \ + && ret=0 + ;; + (mask) + _arguments -C -A '-*' \ + $base_options \ + {'(--rites)-r','(-r)--rites'}'[mark for last rites]' \ + {'(--bugs)-b','(-b)--bugs'}'[reference bug in the mask comment]' \ + '--email[spawn email composer with prepared email for sending to mailing lists]' \ + && ret=0 + ;; + (push) + _arguments -C -A '-*' \ + $base_options \ + {'(--ask)-A','(-A)--ask'}'[confirm pushing commits with QA errors]' \ + {'(--dry-run)-n','(-n)--dry-run'}'[pretend to push commits]' \ + && ret=0 + ;; + (showkw) + _arguments -C -A '-*' \ + $base_options \ + {'(--format)-f','(-f)--format'}'[keywords table format]' \ + {'(--collapse)-c','(-c)--collapse'}'[show collapsed list of arches]' \ + {'(--stable)-s','(-s)--stable'}'[show stable arches]' \ + {'(--unstable)-u','(-u)--unstable'}'[show unstable arches]' \ + {'(--only-unstable)-o','(-o)--only-unstable'}'[show arches that only have unstable keywords]' \ + {'(--prefix)-p','(-p)--prefix'}'[show prefix and non-native arches]' \ + {'(--arch)-a','(-a)--arch'}'[select arches to display]:arch' \ + {'(--repo)-r','(-r)--repo'}'[repo to query]:repo' \ + && ret=0 + ;; + (*) + _nothing + ;; + esac + ;; +esac + +return ret + +# vim: set et sw=2 ts=2 ft=zsh: |