Added function to retrieve organization teams

This commit is contained in:
Seth House
2015-03-24 00:21:57 -04:00
parent 838b67b690
commit 4cd8bfd8ef
+23
View File
@@ -441,6 +441,29 @@ org_repos() {
| _filter ".[] | \"${filter}\""
}
org_teams() {
# List teams
#
# Usage:
# org_teams org
#
# Positional arguments
#
local org=$1
# Organization GitHub login or id.
#
# Keyword arguments
#
local filter='\(.name)\t\(.id)\t\(.permission)'
# A jq filter using string-interpolation syntax that is applied to each
# team in the return data.
[ -n "$org" ] && shift || _err 'Org name required.' E_INVALID_ARGS
request "/orgs/${org}/teams" \
| _filter ".[] | \"${filter}\""
}
create_repo() {
# Create a repository for a user or organization
#