lhpaste cleanup and better saner defaults
This commit is contained in:
parent
1d93264fb7
commit
3adfb237bf
1 changed files with 14 additions and 1 deletions
|
@ -5,7 +5,7 @@ function lhpaste() {
|
|||
local o_expire=(--expire 60)
|
||||
local o_help
|
||||
local o_lang
|
||||
local o_name=(--name Psi-Jack)
|
||||
local o_name
|
||||
local o_private
|
||||
local o_reply
|
||||
local o_title
|
||||
|
@ -15,8 +15,15 @@ function lhpaste() {
|
|||
if [[ -n "$LHPASTE_API_KEY" ]]; then
|
||||
o_apikey=(--apikey "$LHPASTE_API_KEY")
|
||||
fi
|
||||
|
||||
if [[ -n "$LHPASTE_NAME" ]]; then
|
||||
o_name=(--name "$LHPASTE_NAME")
|
||||
else
|
||||
o_name=(--name "$USER")
|
||||
fi
|
||||
|
||||
if [[ -n "$LHPASTE_SERVER_URL" ]]; then
|
||||
o_url=(--url "$LHPASTE_SERVER_URL")
|
||||
fi
|
||||
|
||||
zparseopts -D -K -M -- \
|
||||
|
@ -44,6 +51,12 @@ OPTIONS:
|
|||
--title TEXT, -t TEXT Set paste title text
|
||||
--url URL, -u URL Set paste server URL (Default: $o_url[2])
|
||||
--apikey TEXT, -a TEXT Set API-KEY for Stikked Paste access
|
||||
|
||||
ENVIRONMENT:
|
||||
|
||||
LHPASTE_NAME Set the name to use instead of the default value of \$USER
|
||||
LHPASTE_SERVER_URL Set the server base url to the stikked server
|
||||
LHPASTE_API_KEY Set the apikey to use the stikked server API
|
||||
EOF
|
||||
return 0
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue