summaryrefslogtreecommitdiff
path: root/bin/common/ask
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-02-27 13:02:56 +0100
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-02-27 13:02:56 +0100
commit5c1338a567fd546377b92e5f83358aa017979041 (patch)
tree2012a39f9ae91234ac356a011a6f07a1110586d2 /bin/common/ask
parent457a28ed89be9e2f698786e83538ee61292ae08c (diff)
added -1 option for one explicitly asking one parameter
Diffstat (limited to 'bin/common/ask')
-rwxr-xr-xbin/common/ask9
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/common/ask b/bin/common/ask
index 85b5f9e..e9f6c91 100755
--- a/bin/common/ask
+++ b/bin/common/ask
@@ -1,13 +1,18 @@
-#!/usr/bin/env bash
-# Depends on passmenu
+#!/bin/sh
if [ -z "$1" ]
then
echo -n ">"
read prompt
+elif [ "$1" = "-1" ]
+then
+ shift
+ prompt=$1
+ test -z "$1" || exit 1
else
prompt="$@"
fi
+
API_KEY="$(pass tokens/openai-api)"
data=$(echo \