Skip to content

Commit 1d8dfc2

Browse files
Prepare first gh release (0.1.0)
1 parent 56d9d60 commit 1d8dfc2

File tree

5 files changed

+153
-8
lines changed

5 files changed

+153
-8
lines changed

Makefile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
CC = gcc
22
CC_FLAGS = -g -o
3-
GH_PATH=~/.local/bin/gh
4-
MAN_PATH=~/.local/man/man1/gh.1
3+
GH_DIR=~/.local/bin
4+
MAN_DIR=~/.local/man/man1
55

66
build_tests:
77
$(CC) $(CC_FLAGS) tests.out ./tests/*.c ./src/gh.c -lcmocka -Wl,--wrap=find_git_config -DTESTING
88
install:
9-
$(CC) $(CC_FLAGS) $(GH_PATH) ./src/*.c
10-
cp ./docs/gh.1 $(MAN_PATH)
11-
gzip $(MAN_PATH)
9+
mkdir -p $(GH_DIR)
10+
mkdir -p $(MAN_DIR)
11+
$(CC) $(CC_FLAGS) $(GH_DIR)/gh ./src/*.c
12+
cp ./docs/gh.1 $(MAN_DIR)/gh.1
13+
gzip $(MAN_DIR)/gh.1
1214
uninstall:
13-
rm -f $(GH_PATH)
14-
rm -f $(MAN_PATH).gz
15+
rm -f $(GH_DIR)/gh
16+
rm -f $(MAN_DIR)/gh.1.gz
1517
clean:
1618
rm -f ./*.out

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# gh
2+
3+
gh is a minimal alternative to GitHub CLI. It allows you to rapidly open the repository page, list PRs waiting for review, open new PRs, etc.
4+
5+
## Summary
6+
```bash
7+
# Opens the repository page
8+
$ gh
9+
10+
# Opens the pull request page of the current repository
11+
$ gh pulls
12+
13+
# Opens the pull request page, but only your closed PRs are listed
14+
$ gh pulls --closed \
15+
--author=@me
16+
17+
# Opens the pull request page, but only PRs awaiting review from you are listed
18+
$ gh pulls --to-review
19+
20+
# Opens the pull request form filling some fields
21+
$ gh newpr --dest-src=main..my-branch \
22+
--template=feature.md \
23+
--title=I implemented a very nice feature \
24+
--assignees=gustavothecoder \
25+
--labels=feature,minor
26+
```
27+
28+
## Installation
29+
30+
### Dependencies
31+
32+
You need to be able to compile C code. Installing `build-essential` for Debian-based distros or `base-devel` for Arch-based distros should be sufficient.
33+
34+
Right now FireFox is a dependency too.
35+
36+
### Steps
37+
38+
Just run:
39+
```bash
40+
$ make install
41+
```
42+
43+
To uninstall:
44+
```bash
45+
$ make uninstall
46+
```
47+
48+
## Usage
49+
50+
Run `gh help` or read the manpage [right here](./docs/ascii_man).
51+
52+
## Contributing
53+
54+
Bug reports and pull requests are welcome :)

docs/ascii_man

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
gh(1) User commands gh(1)
2+
3+
4+
5+
NNAAMMEE
6+
gh - A minimal alternative to GitHub CLI.
7+
8+
9+
DDEESSCCRRIIPPTTIIOONN
10+
gh is a CLI that works as an interface to github.com. It requires a
11+
browser for that and right now only Firefox is supported.
12+
13+
14+
SSYYNNOOPPSSIISS
15+
gh [COMMANDS] [OPTIONS]
16+
17+
18+
CCOOMMMMAANNDDSS
19+
gh-help
20+
Prints help.
21+
22+
23+
gh-repo
24+
Open the repository page. When no option is provided, this com-
25+
mand is used by default.
26+
27+
28+
gh-pulls
29+
Open the pull request page of the current repository.
30+
31+
32+
gh-newpr
33+
Open a pull request for the current repository.
34+
35+
36+
GGHH--PPUULLLLSS OOPPTTIIOONNSS
37+
--open Only list open pull requests.
38+
39+
40+
--closed
41+
Only list closed pull requests.
42+
43+
44+
--author=<value>
45+
Filter pull requests by author. `@me` works as an alis to your
46+
Github username.
47+
48+
49+
--to-review
50+
Filter pull requests awaiting review from you.
51+
52+
53+
GGHH--NNEEWWPPRR OOPPTTIIOONNSS
54+
--dest-src=<dest_branch>...<src_branch>
55+
Select the destination branch and the source branch.
56+
57+
58+
--template=<value>
59+
Select the template to be used in the PR description.
60+
61+
62+
--title=<value>
63+
Define the PR title.
64+
65+
66+
--assignees=<value1>,<value2>,<valueN>
67+
Define the PR assignees.
68+
69+
70+
--labels=<value1>,<value2>,valueN>
71+
Define the PR labels.
72+
73+
74+
FFIILLEESS
75+
_~_/_._l_o_c_a_l_/_b_i_n_/_g_h
76+
77+
_~_/_._l_o_c_a_l_/_m_a_n_/_m_a_n_1_/_g_h_._1_._g_z
78+
79+
80+
AAUUTTHHOORR
81+
Gustavo Ribeiro ([email protected])
82+
83+
84+
85+
0.1.0 07 Mar 2024 gh(1)

docs/gh.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH gh 1 "02 Mar 2024" "0.1.0" "User commands"
1+
.TH gh 1 "07 Mar 2024" "0.1.0" "User commands"
22

33
.SH NAME
44
gh \- A minimal alternative to GitHub CLI.

scripts/update_ascii_man.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
rm -f ./docs/ascii_man
2+
touch ./docs/ascii_man
3+
cat ./docs/gh.1 | groff -mandoc -T ascii > ./docs/ascii_man
4+

0 commit comments

Comments
 (0)