aboutsummaryrefslogtreecommitdiffhomepage
path: root/init
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-01-25 09:32:29 +1000
committerGravatar axel <axel@liljencrantz.se>2006-01-25 09:32:29 +1000
commit58931548234dd2ce2ff591a1390a22411b35ac97 (patch)
treee24165050776725bf564b97b584e8802cdb43b58 /init
parent4a4e1788e524a3bf3335722899cec01fb4814ffb (diff)
Add completions for emerge command
darcs-hash:20060124233229-ac50b-401bc6944f5f7bbe4836361061c0ecfe0f982656.gz
Diffstat (limited to 'init')
-rw-r--r--init/completions/emerge.fish68
-rw-r--r--init/fish_complete.fish.in9
2 files changed, 77 insertions, 0 deletions
diff --git a/init/completions/emerge.fish b/init/completions/emerge.fish
new file mode 100644
index 00000000..986fe6b4
--- /dev/null
+++ b/init/completions/emerge.fish
@@ -0,0 +1,68 @@
+#Completions for emerge
+
+function __fish_emerge_use_package -d (_ 'Test if emerge command should have packages as potential completion')
+ for i in (commandline -opc)
+ if contains -- $i -a --ask -p --pretend --oneshot -O --nodeps -f --fetchonly
+ return 0
+ end
+ end
+ return 1
+end
+
+function __fish_emerge_manipulate_package -d (_ 'Tests if emerge command should have package as potential completion for removal')
+ for i in (commandline -opc)
+ if contains -- $i -u --update -C --unmerge -P --prune
+ return 0
+ end
+ end
+ return 1
+end
+
+function __fish_emerge_print_installed_pkgs -d (_ 'Prints completions for installed packages on the system from /var/db/pkg')
+ if test -d /var/db/pkg
+ find /var/db/pkg/ -type d | cut -d'/' -f6 | sort | uniq | sed 's/-[0-9]\{1,\}\..*$//'
+ return
+ end
+end
+
+complete -f -c emerge -n '__fish_emerge_use_package' -a '(__fish_print_packages)' -d (_ 'Package')
+complete -f -c emerge -n '__fish_emerge_manipulate_package' -a '(__fish_emerge_print_installed_pkgs)' -d (_ 'Package')
+complete -c emerge -s h -l help -d (_ "Displays help")
+complete -c emerge -s c -l clean -d (_ "Cleans the system by removing outdated packages")
+complete -c emerge -l depclean -d (_ "Cleans the system by removing packages that are not associated with explicitly merged packages")
+complete -c emerge -l info -d (_ "Displays important portage variables that will be exported to ebuild.sh when performing merges")
+complete -c emerge -l metadata -d (_ "Causes portage to process all the metacache files as is normally done on the tail end of an rsync update using emerge --sync")
+complete -c emerge -s P -l prune -d (_ "Removes all but the most recently installed version of a package from your system")
+complete -c emerge -l regen -d (_ "Causes portage to check and update the dependency cache of all ebuilds in the portage tree")
+complete -c emerge -s s -l search -d (_ "Searches for matches of the supplied string in the current local portage tree")
+complete -c emerge -s C -l unmerge -d (_ "Removes all matching packages completely from your system")
+complete -c emerge -s a -l ask -d (_ "Before performing the merge, display what ebuilds and tbz2s will be installed, in the same format as when using --pretend")
+complete -c emerge -s b -l buildpkg -d (_ "Tell emerge to build binary packages for all ebuilds processed in addition to actually merging the packages")
+complete -c emerge -s B -l buildpkgonly -d (_ "Creates a binary package, but does not merge it to the system")
+complete -c emerge -s l -l changelog -d (_ "When pretending, also display the ChangeLog entries for packages that will be upgraded")
+complete -c emerge -l columns -d (_ "Display the pretend output in a tabular form")
+complete -c emerge -s d -l debug -d (_ "Tell emerge to run the ebuild command in --debug mode")
+complete -c emerge -s d -l deep -d (_ "When used in conjunction with --update, this flag forces emerge to consider the entire dependency tree of packages, instead of checking only the immediate dependencies of the packages")
+complete -c emerge -s e -l emptytree -d (_ "Virtually tweaks the tree of installed packages to contain nothing")
+complete -c emerge -s f -l fetchonly -d (_ "Instead of doing any package building, just perform fetches for all packages (main package as well as all dependencies)")
+complete -c emerge -l fetch-all-uri -d (_ "Same as --fetchonly except that all package files, including those not required to build the package, will be processed")
+complete -c emerge -s g -l getbinpkg -d (_ "Using the server and location defined in PORTAGE_BINHOST, portage will download the information from each binary file there and it will use that information to help build the dependency list")
+complete -c emerge -s G -l getbinpkgonly -d (_ "This option is identical to -g, except it will not use ANY information from the local machine")
+complete -c emerge -l newuse -d (_ "Tells emerge to include installed packages where USE flags have changed since installation")
+complete -c emerge -l noconfmem -d (_ "Portage keeps track of files that have been placed into CONFIG_PROTECT directories, and normally it will not merge the same file more than once, as that would become annoying")
+complete -c emerge -s O -l nodeps -d (_ "Merge specified packages, but don't merge any dependencies")
+complete -c emerge -s n -l noreplace -d (_ "Skip the packages specified on the command-line that have already been installed")
+complete -c emerge -l nospinner -d (_ "Disables the spinner regardless of terminal type")
+complete -c emerge -l oneshot -d (_ "Emerge as normal, but don't add packages to the world profile")
+complete -c emerge -s o -l onlydeps -d (_ "Only merge (or pretend to merge) the dependencies of the specified packages, not the packages themselves")
+complete -c emerge -s p -l pretend -d (_ "Instead of actually performing the merge, simply display what ebuilds and tbz2s *would* have been installed if --pretend weren't used")
+complete -c emerge -s q -l quiet -d (_ "Effects vary, but the general outcome is a reduced or condensed output from portage's displays")
+complete -c emerge -l resume -d (_ "Resumes the last merge operation")
+complete -c emerge -s S -l searchdesc -d (_ "Matches the search string against the description field as well the package's name")
+complete -c emerge -l skipfirst -d (_ "This option is only valid in a resume situation. It removes the first package in the resume list so that a merge may continue in the presence of an uncorrectable or inconsequential error")
+complete -c emerge -s t -l tree -d (_ "Shows the dependency tree using indentation for dependencies")
+complete -c emerge -s u -l update -d (_ "Updates packages to the best version available, which may not always be the highest version number due to masking for testing and development")
+complete -c emerge -s k -l usepkg -d (_ "Tell emerge to use binary packages (from $PKGDIR) if they are available, thus possibly avoiding some time-consuming compiles")
+complete -c emerge -s K -l usepkgonly -d (_ "Like --usepkg, except this only allows the use of binary packages, and it will abort the emerge if the package is not available at the time of dependency calculation")
+complete -c emerge -s v -l verbose -d (_ "Effects vary, but the general outcome is an increased or expanded display of content in portage's displays")
+complete -c emerge -s V -l version -d (_ "Displays the currently installed version of portage along with other information useful for quick reference on a system")
diff --git a/init/fish_complete.fish.in b/init/fish_complete.fish.in
index f752040c..83674bca 100644
--- a/init/fish_complete.fish.in
+++ b/init/fish_complete.fish.in
@@ -232,6 +232,15 @@ function __fish_print_packages
# Remove package version information from output and pipe into cache file
rpm -qa >$cache_file |sed -e 's/-[^-]*-[^-]*$//' | sed -e 's/$/\t'$package'/' &
end
+
+ # This completes the package name from the portage tree.
+ # True for installing new packages. Function for printing
+ # installed on the system packages is in completions/emerge.fish
+ if which emerge >/dev/null ^/dev/null
+ emerge -s \^(commandline -tc) |grep "^*" |cut -d\ -f3 |cut -d/ -f2
+ return
+ end
+
end