Skip to content

Commit 947f0dc

Browse files
committed
add makefile rule for completions
add fish to docs
1 parent 44db958 commit 947f0dc

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,13 @@ generate-manpage: ## generate manpage
915915
@gzip -9 man/man1/gitea.1 && echo man/man1/gitea.1.gz created
916916
@#TODO A small script that formats config-cheat-sheet.en-us.md nicely for use as a config man page
917917

918+
.PHONY: generate-completions
919+
generate-completions: ## generate shell completions
920+
@[ -f gitea ] || make backend
921+
@./gitea completion bash > contrib/autocompletion/bash_autocomplete
922+
@./gitea completion zsh > contrib/autocompletion/zsh_autocomplete
923+
@./gitea completion fish > contrib/autocompletion/gitea.fish
924+
918925
.PHONY: docker
919926
docker:
920927
docker build --disable-content-trust=false -t $(DOCKER_REF) .

contrib/autocompletion/README

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,17 @@ From within the gitea root run:
77
source contrib/autocompletion/bash_autocomplete
88
```
99

10-
or for zsh run:
10+
for zsh run:
1111

12-
```bash
12+
```zsh
1313
source contrib/autocompletion/zsh_autocomplete
1414
```
1515

16+
and for fish:
17+
18+
```fish
19+
source contrib/autocompletion/gitea.fish
20+
```
21+
1622
These scripts will check if gitea is on the path and if so add autocompletion for `gitea`. Or if not autocompletion will work for `./gitea`.
1723
If gitea has been installed as a different program pass in the `PROG` environment variable to set the correct program name.

0 commit comments

Comments
 (0)