summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorschrmh2018-09-17 06:00:34 +0200
committerschrmh2018-09-17 06:00:34 +0200
commit551428f3f01d0885037d0356ddb4239ea4751117 (patch)
tree2619c51d3c057777bd8652df6e6d57f13e431a2b
parentf7fa1d0989ef9a3f279917df2c6d76490fd297e0 (diff)
downloadaur-551428f3f01d0885037d0356ddb4239ea4751117.tar.gz
output of fake input now matches to the fake package name
-rwxr-xr-xfakeAUR.sh57
1 files changed, 57 insertions, 0 deletions
diff --git a/fakeAUR.sh b/fakeAUR.sh
new file mode 100755
index 000000000000..06ec29925f8a
--- /dev/null
+++ b/fakeAUR.sh
@@ -0,0 +1,57 @@
+#!/bin/bash -i
+#Developer: schrmh (schreibemirhalt@gmail.com) / derberg#7221 from Linux Gaming Discord
+#Git-Repo:
+function show_help () {
+ echo "fakeAUR"
+ echo "You need to use the option -echo and provide AUR helper (e.g. yay) + old name package name, new package name and new description:"
+ echo "fakeAUR -echo \"yay fakeAUR\" nani \"now you can speak japanese\""
+ echo ""
+ echo "use -btw for a btwiusearch message and -nani for that nani message."
+ echo "-grep will grep the original description of the piped package"
+ echo "TODO: 1). switch between core/community/aur or custom with colour. Also version, size, orphanded, etc."
+ echo "2) Manipulate multiple packages at once and list them just like a package helper would"
+ echo "3) Copy a screnshoot to clipboard"
+ echo "4) implement piping: yay fakeAUR | fakeAUR nani \"now you can speak japanese\""
+ echo "5) Fix formatted output for trizen.."
+}
+if [ $# -eq 0 ]
+then
+ show_help
+ exit 1
+fi
+
+for i in "$@"
+ do
+ case $i in
+ -h | --h | --help )
+ show_help
+ exit 1
+ ;;
+ -btw )
+ description=$(echo -ne '\n' | eval "$2" | grep " ")
+ name=$(echo $2 | grep -Eo "[^ ]+$")
+ helper=$(echo $2 | grep -o '^\S*')
+ echo ${PS1@P}$helper btwiusearch
+ echo -ne '\n' | eval $2 | sed -e "s/$name/btwiusearch/" | sed -e "s/$description/A very important and easy to use package to show the world that you run the best distro/"
+ ;;
+ -nani )
+ description=$(echo -ne '\n' | eval "$2" | grep " ")
+ name=$(echo $2 | grep -Eo "[^ ]+$")
+ helper=$(echo $2 | grep -o '^\S*')
+ echo ${PS1@P}$helper nani
+ echo -ne '\n' | eval $2 | sed -e "s/$name/nani/" | sed -e "s/$description/now you can speak japanese/"
+ ;;
+ -echo )
+ description=$(echo -ne '\n' | eval "$2" | grep " ")
+ name=$(echo $2 | grep -Eo "[^ ]+$")
+ helper=$(echo $2 | grep -o '^\S*')
+ echo ${PS1@P}$helper $3
+ echo -ne '\n' | eval $2 | sed -e "s/$name/$3/" | sed -e "s/$description/$4/"
+ ;;
+ -grep)
+ description=$(echo -ne '\n' | eval "$2" | grep " ")
+ echo $description
+ ;;
+ esac
+ done
+exit 0