aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJulio Capote <jcapote@gmail.com>2022-08-21 15:30:42 +0000
committerJulio Capote <jcapote@gmail.com>2022-08-21 15:30:42 +0000
commita44d810632cb9b9527b6b220d486cea577802c72 (patch)
tree912a6da9ec6ec2e6e28ec064e0d7b6981e167e41 /lib
parente8910ecd98488bc2dcc82389a82b14ca2361617a (diff)
downloadrecit-a44d810632cb9b9527b6b220d486cea577802c72.tar.gz
move recsel calls to its own file
Diffstat (limited to '')
-rwxr-xr-xlibexec/recit-entries14
-rwxr-xr-xlibexec/recit-projects7
-rwxr-xr-xlibexec/recit-recsel-entries14
-rwxr-xr-xlibexec/recit-recsel-projects14
4 files changed, 37 insertions, 12 deletions
diff --git a/libexec/recit-entries b/libexec/recit-entries
index 9cb45ca..3888963 100755
--- a/libexec/recit-entries
+++ b/libexec/recit-entries
@@ -58,9 +58,11 @@ if ! [[ "$project" = "" ]]; then
fi
fi
-if [[ "$expression" = "" ]]; then
- out=$(recsel -t Entry "${recfile}" | recfmt -f share/recit/templates/entries.templ)
- echo -e "$out"
-else
- recsel -t Entry -e "$expression" "${recfile}"
-fi
+recit-recsel-entries "$expression"
+
+# if [[ "$expression" = "" ]]; then
+# out=$(recsel -t Entry "${recfile}" | recfmt -f share/recit/templates/entries.templ)
+# else
+# out=$(recsel -t Entry "${recfile}" -e "$expression" | recfmt -f share/recit/templates/entries.templ)
+# fi
+# echo -e "$out" \ No newline at end of file
diff --git a/libexec/recit-projects b/libexec/recit-projects
index 50aa485..4217397 100755
--- a/libexec/recit-projects
+++ b/libexec/recit-projects
@@ -2,9 +2,4 @@
# Usage: recit projects
# Summary: List all Projects
-source lib/loader
-
-recfile=$(load_recit)
-
-recsel -t Project ${recfile}
-
+recit-recsel-projects
diff --git a/libexec/recit-recsel-entries b/libexec/recit-recsel-entries
new file mode 100755
index 0000000..5b6070a
--- /dev/null
+++ b/libexec/recit-recsel-entries
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+set -e
+
+# shellcheck source=/dev/null
+source lib/loader
+
+recfile=$(load_recit)
+
+if [[ "$1" = "" ]]; then
+ out=$(recsel -t Entry "${recfile}" | recfmt -f share/recit/templates/entries.templ)
+else
+ out=$(recsel -t Entry "${recfile}" -e "$1" | recfmt -f share/recit/templates/entries.templ)
+fi
+echo -e "$out"
diff --git a/libexec/recit-recsel-projects b/libexec/recit-recsel-projects
new file mode 100755
index 0000000..f7778e9
--- /dev/null
+++ b/libexec/recit-recsel-projects
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+set -e
+
+# shellcheck source=/dev/null
+source lib/loader
+
+recfile=$(load_recit)
+
+if [[ "$1" = "" ]]; then
+ out=$(recsel -t Project "${recfile}" | recfmt -f share/recit/templates/projects.templ)
+else
+ out=$(recsel -t Project "${recfile}" -e "$1" | recfmt -f share/recit/templates/projects.templ)
+fi
+echo -e "$out"