commands now accept multiple arguments where it makes sense.
#### before
```
NAME:
tea issues close - Change state of an issue to 'closed'
USAGE:
tea issues close [command options] <issue index>
```
#### after
```
NAME:
tea issues close - Change state of one ore more issues to 'closed'
USAGE:
tea issues close [command options] <issue index> [<issue index>...]
```
Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/512
Reviewed-by: 6543 <6543@obermui.de>
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
This changes the command help string from eg
```
NAME:
tea label create - Create a label
USAGE:
tea label [command options] [arguments...]
```
to
```
NAME:
tea label create - Create a label
USAGE:
tea label [command options]
```
Hopefully improving usability.
---
edit: this also changes `tea release create` to take the `--tag` flag value optionally via the first argument, as this seems to be a clear UX improvement.
fixes#483
Co-authored-by: Norwin <git@nroo.de>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/496
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: 6543 <6543@obermui.de>
Reviewed-by: delvh <delvh@noreply.gitea.io>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
This adds new filters to `tea issues ls` and `tea pr ls`, made available in SDK 0.15:
```
--state value Filter by state (all|open|closed) (default: open)
--keyword value, -k value Filter by search string
--labels value, -L value Comma-separated list of labels to match issues against.
--milestones value, -m value Comma-separated list of milestones to match issues against.
--author value, -A value
--assignee value, -a value
--mentions value, -M value
--from value, -F value Filter by activity after this date
--until value, -u value Filter by activity before this date
```
Note: I felt free to change parameter names as exposed by SDK & API, as the names exposed by them are partially bollocks (eg `mentioned_by`) and or inconsistent with usage in other commands (eg `tea times --until`)
fixes#376, related #323
Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/400
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
This PR adds the `--fields` flag to `tea pr ls` (#342), and exposes more fields specific to the `PullRequest` type:
```
--fields value, -f value Comma-separated list of fields to print.
Available values:
index,state,author,author-id,url,title,body,mergeable,base,base-commit,head,diff,patch,created,updated,deadline,assignees,milestone,labels,comments
(default: "index,title,state,author,milestone,updated,labels")
```
Co-authored-by: justusbunsi <61625851+justusbunsi@users.noreply.github.com>
Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/415
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-committed-by: justusbunsi <justusbunsi@noreply.gitea.io>
this is a partial fix to #378, making the command available outside of a local repo.
new behaviour:
- when run interactively without local repo context, the head repo prompt is not pre-populated
- when run with flags without local repo context, it will complain unless `--head` is specified
refactor:
- pass TeaContext down to task.CreatePull
Co-authored-by: Norwin <git@nroo.de>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/393
Reviewed-by: Alexey 〒erentyev <axifive@noreply.gitea.io>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
This avoids creation of local branches, to avoid cluttering the local repo:
- if the commit already exists on the tip of a local branch, check that one out
- otherwise check out the remote tracking branch (`refs/remotes/<remote>/<head>`), and suggest what to do if you want to make changes.
I'm not certain this behaviour is actually better, I suggest leaving this open for a while for people to try out the new behaviour:
```
tea pr checkout 314
make install
```
fixes#293
Co-authored-by: Norwin Roosen <git@nroo.de>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/314
Reviewed-by: 6543 <6543@obermui.de>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
Implement pull request closing/reopening
Signed-off-by: Martin Reboredo <yakoyoku@gmail.com>
Correct year and `pull` description
Apply changes from #291
Return fmt.Errorf instead of log.Fatal if no pull index was supplied
Co-authored-by: Martin Reboredo <yakoyoku@gmail.com>
Reviewed-on: https://gitea.com/gitea/tea/pulls/304
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Reviewed-by: appleboy <appleboy.tw@gmail.com>
Co-Authored-By: Martin Reboredo <yakoyakoyokuyoku@noreply.gitea.io>
Co-Committed-By: Martin Reboredo <yakoyakoyokuyoku@noreply.gitea.io>
introduce TeaContext
clean up InitCommand
move GetListOptions to TeaContext
ensure context for each command
so we fail early with a good error message instead of "Error: 404" etc
make linter happy
Merge branch 'master' into refactor-global-flags
move TeaContext & InitCommand to modules/context
Merge branch 'master' into refactor-global-flags
CI.restart()
Merge branch 'master' into refactor-global-flags
Merge branch 'master' into refactor-global-flags
Co-authored-by: Norwin Roosen <git@nroo.de>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/291
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: khmarbaise <khmarbaise@noreply.gitea.io>
Reviewed-by: 6543 <6543@obermui.de>
Co-Authored-By: Norwin <noerw@noreply.gitea.io>
Co-Committed-By: Norwin <noerw@noreply.gitea.io>
Pull Detailview: add head/base-branch, reviews, mergable info
print info if reviews can not be loaded
No Conflicts
Reviewed-on: https://gitea.com/gitea/tea/pulls/271
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-Authored-By: 6543 <6543@obermui.de>
Co-Committed-By: 6543 <6543@obermui.de>
improved logging
try to use local branch before creating pulls/<PR>
useful for checking out your own PRs
reorder imports
refactor pulls checkout
isolated "gitea API to local git cfg" aspect
work around go-git limitation
As we cant manage multiple remote URLs properly, we just set the correct
URL protocol ahead of time.
This logic won't apply for already existing HTTPS remotes, these
should be deleted before using `tea pr checkout`.
use SSH if user has key in gitea
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Norwin Roosen <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/192
Reviewed-by: 6543 <6543@noreply.gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-Authored-By: Norwin <noerw@noreply.gitea.io>
Co-Committed-By: Norwin <noerw@noreply.gitea.io>
dont resolve location ahead of time
fixup! use local timezone for all printed times
fixup! use local timezone for all printed times
use local timezone for all printed times
Co-authored-by: Norwin Roosen <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/217
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: 6543 <6543@noreply.gitea.io>
drop tea mile alias
document command schema in CONTRIBUTING.md
and update this file, its a plain copy from gitea
add "list" as alias for "ls" subcommand
add singular command aliases
Co-authored-by: Norwin Roosen <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/208
Reviewed-by: 6543 <6543@noreply.gitea.io>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
simplify NormalizeURL
drop noisy log line
must have been introduced recently?
dont use PascalCase for default login names
...for readability.
🔥 opinionated commit
create GenerateLoginName()
fixes
fixup! Merge branch 'master' into refactor-loginMain
move GetOwnerAndRepo() to modules/utils/parse.go
Merge branch 'master' into refactor-loginMain
make linter happy
refactor addLoginMain()
Co-authored-by: Norwin Roosen <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/201
Reviewed-by: 6543 <6543@noreply.gitea.io>
Reviewed-by: Andrew Thornton <art27@cantab.net>
fix lint
fix lint
Move print TrackedTimesList to print package
Move AbsPathWithExpansion to utils/path.go
rename module intern to config
Move Subcomands into it's own Packages
Split times subcomands into own sourcefiles
Split repos subcomands into own sourcefiles
Split releases subcomands into own sourcefiles
Split pulls subcomands into own sourcefiles
Split milestones subcomands into own sourcefiles
Split login subcomands into own sourcefiles
Split labels subcomands into own sourcefiles
split issues subcomands into own sourcefiles
mv
Move Interactive Login Creation to interact package
Move Add Login function to intern/login.go
apply from review
lint: add description to exported func
smal nits
Move DetailViews stdout print func to print package
Refactor:
* Move Config & Login routines into intern package
* rename global var in cmd
* Move help func to utils
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/206
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>