From c24cc0f4ef43be035cf31116c46904f723b5607f Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Sun, 21 Aug 2022 11:31:03 -0400 Subject: recit-setup and recit-ls alias --- libexec/recit-ls | 3 +++ libexec/recit-setup | 12 ++++++++---- share/recit/recit.example.rec | 11 ++++++----- share/recit/templates/projects.templ | 3 +++ 4 files changed, 20 insertions(+), 9 deletions(-) create mode 100755 libexec/recit-ls create mode 100644 share/recit/templates/projects.templ diff --git a/libexec/recit-ls b/libexec/recit-ls new file mode 100755 index 0000000..2eb086b --- /dev/null +++ b/libexec/recit-ls @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +recit-entries "$@" \ No newline at end of file diff --git a/libexec/recit-setup b/libexec/recit-setup index fb8ce61..ba34026 100755 --- a/libexec/recit-setup +++ b/libexec/recit-setup @@ -1,11 +1,15 @@ #!/usr/bin/env bash +# Usage: recit setup [force] +# Summary: sets up a new recit database at $HOME/.recit.rec set -e -if [[ -f "$HOME/.recit.location" ]]; then - recfile_location=$(cat "$HOME/.recit.location") - echo "looks like you already have recit set up at ${recfile_location}, aborting..." - exit 1 +if ! [[ "$1" = "force" ]]; then + if [[ -f "$HOME/.recit.location" ]]; then + recfile_location=$(cat "$HOME/.recit.location") + echo "looks like you already have recit set up at ${recfile_location}, aborting..." + exit 1 + fi fi cat share/recit/recit.example.rec > "$HOME/.recit.rec" diff --git a/share/recit/recit.example.rec b/share/recit/recit.example.rec index 81cfc8c..ec394d6 100644 --- a/share/recit/recit.example.rec +++ b/share/recit/recit.example.rec @@ -1,13 +1,14 @@ +# recit recutils recfile template/schema +# Version: 0.0.2 %rec: Project %key: Id - -Id: example-project -Status: open -Notes: blah blah +%mandatory: Name Status +%allowed: Notes %rec: Entry %key: Id %type: Time date %auto: Time %type: ProjectRef rec Project -%sort: Time \ No newline at end of file +%sort: Time +%mandatory: Id Time Notes \ No newline at end of file diff --git a/share/recit/templates/projects.templ b/share/recit/templates/projects.templ new file mode 100644 index 0000000..cfe77ba --- /dev/null +++ b/share/recit/templates/projects.templ @@ -0,0 +1,3 @@ +\033[1;33m{{Id}}\033[0m ({{Status}}) +{{Notes}} + -- cgit v1.2.3