add help argument to jira plugin. Update README

This commit is contained in:
Jim Weller 2024-03-20 21:45:17 -07:00
commit 7ec8ce3cf2
No known key found for this signature in database
GPG key ID: 7E91BDDAC18B597D
3 changed files with 22 additions and 1 deletions

View file

@ -2,6 +2,21 @@
#
# See README.md for details
function usage() {
cat <<EOF
jira Performs the default action
jira new Opens a new Jira issue dialogue
jira ABC-123 Opens an existing issue
jira ABC-123 m Opens an existing issue for adding a comment
jira dashboard [rapid_view] # Opens your JIRA dashboard
jira mine Queries for your own issues
jira tempo Opens your JIRA Tempo
jira reported [username] Queries for issues reported by a user
jira assigned [username] Queries for issues assigned to a user
jira branch Opens an existing issue matching the current branch name
EOF
}
function jira() {
emulate -L zsh
local action jira_url jira_prefix
@ -44,6 +59,8 @@ function jira() {
open_command "${jira_url}/secure/CreateIssue!default.jspa"
elif [[ "$action" == "assigned" || "$action" == "reported" ]]; then
_jira_query ${@:-$action}
elif [[ "$action" == "help" || "$action" == "usage" ]]; then
usage
elif [[ "$action" == "mine" ]]; then
echo "Opening my issues"
open_command "${jira_url}/issues/?filter=-1"