about summary refs log tree commit diff
path: root/fish/functions
diff options
context:
space:
mode:
Diffstat (limited to 'fish/functions')
-rw-r--r--fish/functions/__xtools_complete_archs.fish3
-rw-r--r--fish/functions/__xtools_complete_one_package.fish4
-rw-r--r--fish/functions/__xtools_complete_packages.fish3
-rw-r--r--fish/functions/__xtools_complete_repo_urls.fish9
4 files changed, 19 insertions, 0 deletions
diff --git a/fish/functions/__xtools_complete_archs.fish b/fish/functions/__xtools_complete_archs.fish
new file mode 100644
index 0000000..6a1165d
--- /dev/null
+++ b/fish/functions/__xtools_complete_archs.fish
@@ -0,0 +1,3 @@
+function __xtools_complete_archs
+    printf %s\n {aarch64,armv{6,7}l,i686,x86_64}{,-musl}\tArchitecture
+end
diff --git a/fish/functions/__xtools_complete_one_package.fish b/fish/functions/__xtools_complete_one_package.fish
new file mode 100644
index 0000000..fcaec36
--- /dev/null
+++ b/fish/functions/__xtools_complete_one_package.fish
@@ -0,0 +1,4 @@
+function __xtools_complete_one_package
+    [ (count (commandline -poc)) -eq 1 ]
+    and __xtools_complete_packages
+end
diff --git a/fish/functions/__xtools_complete_packages.fish b/fish/functions/__xtools_complete_packages.fish
new file mode 100644
index 0000000..a3b53af
--- /dev/null
+++ b/fish/functions/__xtools_complete_packages.fish
@@ -0,0 +1,3 @@
+function __xtools_complete_packages
+    printf %s\n (path basename -- (xdistdir)/srcpkgs/*)\tPackage
+end
diff --git a/fish/functions/__xtools_complete_repo_urls.fish b/fish/functions/__xtools_complete_repo_urls.fish
new file mode 100644
index 0000000..052d234
--- /dev/null
+++ b/fish/functions/__xtools_complete_repo_urls.fish
@@ -0,0 +1,9 @@
+function __xtools_complete_repo_urls
+    if [ -e /usr/share/xmirror/mirrors.lst ]
+        string match -vr '^\s*#' </usr/share/xmirror/mirrors.lst | while read -l line
+            set -l values (string split \t -- $line)
+            # Mirror url, location, and tier
+            echo -- $values[2]\t$values[3], Tier $values[4]
+        end
+    end
+end