From 29b67030b8ab5f54957359853ff470af6cf624b7 Mon Sep 17 00:00:00 2001 From: Wilke Schwiedop Date: Sun, 15 Apr 2018 18:21:30 +0200 Subject: [PATCH] add completion for 'ebuild' command --- share/completions/ebuild.fish | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 share/completions/ebuild.fish diff --git a/share/completions/ebuild.fish b/share/completions/ebuild.fish new file mode 100644 index 000000000..d09d1d2a8 --- /dev/null +++ b/share/completions/ebuild.fish @@ -0,0 +1,43 @@ +function __fish_seen_ebuild_arg -d "Test if an ebuild-argument has been given in the current commandline" + set -l cmd (commandline -poc) + set -e cmd[1] + for i in $cmd + switch $i + case '*.ebuild' + return 0 + end + end + return 1 +end + +## Opts +complete -c ebuild -l debug -d "Run bash with the -x option" +complete -c ebuild -l color -d "Enable color" \ + -xa "y n" +complete -c ebuild -l force -d "Force regeneration of digests" +complete -c ebuild -l ignore-default-opts -d "Ignore EBUILD_DEFAULT_OPTS" +complete -c ebuild -l skip-manifest -d "Skip all manifest checks" + +## Subcommands +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'help' -d "Show help" +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'setup' -d "Run setup and system checks" +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'clean' -d "Clean build dir" +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'fetch' -d "Fetches all files from SRC_URI" +#complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'digest' -d "Deprecared: see manifest" +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'manifest' -d "Update pkg manifest" +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'unpack' -d "Extracts sources" +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'prepare' -d "Run src_prepare()" +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'configure' -d "Run src_configure()" +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'compile' -d "Run src_compile()" +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'test' -d "Run tests" +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'preinst' -d "Run pkg_preinst()" +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'install' -d "Run src_install()" +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'postinst' -d "Run pkg_postinst()" +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'qmerge' -d "Install files to live filesystem" +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'merge' -d "Run fetch, unpack, compile, install and qmerge" +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'unmerge' -d "Uninstall files from live filesystem" +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'prerm' -d "Run pkg_prerm()" +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'postrm' -d "Run pkg_postrm()" +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'config' -d "Run post-install configuration" +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'package' -d "Create a binpkg in PKGDIR" +complete -c ebuild -n '__fish_seen_ebuild_arg' -xa 'rpm' -d "Builds a RedHat RPM pkg"