Tokenstring`goptions:"-s, --security-token, description='Github token ($GITHUB_TOKEN if set). required if repo is private.'"`
Userstring`goptions:"-u, --user, description='Github repo user or organisation (required if $GITHUB_USER not set)'"`
AuthUserstring`goptions:"-a, --auth-user, description='Username for authenticating to the API (falls back to $GITHUB_AUTH_USER or $GITHUB_USER)'"`
Repostring`goptions:"-r, --repo, description='Github repo (required if $GITHUB_REPO not set)'"`
Latestbool`goptions:"-l, --latest, description='Download latest release (required if tag is not specified)',mutexgroup='input'"`
Tagstring`goptions:"-t, --tag, description='Git tag to download from (required if latest is not specified)', mutexgroup='input',obligatory"`
Namestring`goptions:"-n, --name, description='Name of the file', obligatory"`
} `goptions:"download"`
Uploadstruct {
Tokenstring`goptions:"-s, --security-token, description='Github token (required if $GITHUB_TOKEN not set)'"`
Userstring`goptions:"-u, --user, description='Github repo user or organisation (required if $GITHUB_USER not set)'"`
AuthUserstring`goptions:"-a, --auth-user, description='Username for authenticating to the API (falls back to $GITHUB_AUTH_USER or $GITHUB_USER)'"`
Repostring`goptions:"-r, --repo, description='Github repo (required if $GITHUB_REPO not set)'"`
Tagstring`goptions:"-t, --tag, description='Git tag to upload to', obligatory"`
Namestring`goptions:"-n, --name, description='Name of the file', obligatory"`
Labelstring`goptions:"-l, --label, description='Label (description) of the file'"`
File*os.File`goptions:"-f, --file, description='File to upload (use - for stdin)', rdonly, obligatory"`
Replacebool`goptions:"-R, --replace, description='Replace asset with same name if it already exists (WARNING: not atomic, failure to upload will remove the original asset too)'"`
} `goptions:"upload"`
Releasestruct {
Tokenstring`goptions:"-s, --security-token, description='Github token (required if $GITHUB_TOKEN not set)'"`
Userstring`goptions:"-u, --user, description='Github repo user or organisation (required if $GITHUB_USER not set)'"`
Repostring`goptions:"-r, --repo, description='Github repo (required if $GITHUB_REPO not set)'"`
Tagstring`goptions:"-t, --tag, obligatory, description='Git tag to create a release from'"`
Namestring`goptions:"-n, --name, description='Name of the release (defaults to tag)'"`
Descstring`goptions:"-d, --description, description='Release description, use - for reading a description from stdin (defaults to tag)'"`
Targetstring`goptions:"-c, --target, description='Commit SHA or branch to create release of (defaults to the repository default branch)'"`
Draftbool`goptions:"--draft, description='The release is a draft'"`
Prereleasebool`goptions:"-p, --pre-release, description='The release is a pre-release'"`
GenerateReleaseNotesbool`goptions:"-g, --generate-release-notes, description='Generate name and description if not given'"`
} `goptions:"release"`
Editstruct {
Tokenstring`goptions:"-s, --security-token, description='Github token (required if $GITHUB_TOKEN not set)'"`
Userstring`goptions:"-u, --user, description='Github repo user or organisation (required if $GITHUB_USER not set)'"`
AuthUserstring`goptions:"-a, --auth-user, description='Username for authenticating to the API (falls back to $GITHUB_AUTH_USER or $GITHUB_USER)'"`
Repostring`goptions:"-r, --repo, description='Github repo (required if $GITHUB_REPO not set)'"`
Tagstring`goptions:"-t, --tag, obligatory, description='Git tag to edit the release of'"`
Namestring`goptions:"-n, --name, description='New name of the release (defaults to tag)'"`
Descstring`goptions:"-d, --description, description='New release description, use - for reading a description from stdin (defaults to tag)'"`
Draftbool`goptions:"--draft, description='The release is a draft'"`
Prereleasebool`goptions:"-p, --pre-release, description='The release is a pre-release'"`
} `goptions:"edit"`
Deletestruct {
Tokenstring`goptions:"-s, --security-token, description='Github token (required if $GITHUB_TOKEN not set)'"`
Userstring`goptions:"-u, --user, description='Github repo user or organisation (required if $GITHUB_USER not set)'"`
AuthUserstring`goptions:"-a, --auth-user, description='Username for authenticating to the API (falls back to $GITHUB_AUTH_USER or $GITHUB_USER)'"`
Repostring`goptions:"-r, --repo, description='Github repo (required if $GITHUB_REPO not set)'"`
Tagstring`goptions:"-t, --tag, obligatory, description='Git tag of release to delete'"`
} `goptions:"delete"`
Infostruct {
Tokenstring`goptions:"-s, --security-token, description='Github token ($GITHUB_TOKEN if set). required if repo is private.'"`
Userstring`goptions:"-u, --user, description='Github repo user or organisation (required if $GITHUB_USER not set)'"`
AuthUserstring`goptions:"-a, --auth-user, description='Username for authenticating to the API (falls back to $GITHUB_AUTH_USER or $GITHUB_USER)'"`
Repostring`goptions:"-r, --repo, description='Github repo (required if $GITHUB_REPO not set)'"`
Tagstring`goptions:"-t, --tag, description='Git tag to query (optional)'"`
JSONbool`goptions:"-j, --json, description='Emit info as JSON instead of text'"`
} `goptions:"info"`
}
typeCommandfunc(Options) error
varcommands=map[goptions.Verbs]Command{
"download": downloadcmd,
"upload": uploadcmd,
"release": releasecmd,
"edit": editcmd,
"delete": deletecmd,
"info": infocmd,
}
var (
VERBOSITY=0
)
var (
// The user whose token is being used to authenticate to the API. If unset,