From 9e4f34a5989f6be48eaaebf17c8e42e61ebf3d76 Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Sat, 20 Aug 2022 22:13:15 -0400 Subject: add entries command --- libexec/recit-entries | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 libexec/recit-entries (limited to 'libexec') diff --git a/libexec/recit-entries b/libexec/recit-entries new file mode 100755 index 0000000..343006d --- /dev/null +++ b/libexec/recit-entries @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +# Usage: recit entries [-p project-name] + +# shellcheck source=/dev/null +source lib/loader + +recfile=$(load_recit) + +project="" + +while getopts "p:" options; do + + case "${options}" in + p) + project=${OPTARG} + ;; + :) + echo "Error: -${OPTARG} requires an argument." + exit 1 + ;; + *) + exit 1 + ;; + esac +done + +if [[ "$project" = "" ]]; then + recsel -t Entry "${recfile}" +else + if recsel -t Project -p Id ${recfile} | grep "$project" > /dev/null; then + recsel -e "ProjectRef = '$project'" -t Entry "${recfile}" + else + echo "$project not found, list of available projects:" + recsel -t Project -p Id ${recfile} + fi +fi + -- cgit v1.2.3