-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgst.1
More file actions
182 lines (161 loc) · 3.48 KB
/
gst.1
File metadata and controls
182 lines (161 loc) · 3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
.TH GST 1 "April 2020" "gst 0.1"
.PP
.SH NAME
gst \- painless gist creator
.PP
.SH SYNOPSIS
gst [-pPhv] [-e ID [-D FILE]] [-d DESCRIPTION] [-f FILENAME] [-g URL] [-u USER[:PASSWORD] | -U] FILES ...
.PP
.SH DESCRIPTION
.PP
Easy way to create GitHub Gists through the command line. Simply give it the files to upload and gst will return the URL to the new gist.
.PP
.SH OPTIONS
.TP
\fB-e \fP\fIID\fP
Edit previously created gist specified with \fIID\fP
.PP
.TP
\fB-d \fP\fIDESCRIPTION\fP
Set gist description
.PP
.TP
\fB-D \fP\fIFILE\fP
Delete \fIFILE\fP from gist being edited
.PP
.TP
\fB-f \fP\fIFILENAME\fP
Set file name when reading from 'stdin'
.PP
.TP
\fB-g \fP\fIURL\fP
Change the GitHub API URL (default: https://api.github.com/gists)
.PP
.TP
\fB-p\fP
Make gist private
.PP
.TP
\fB-P\fP
Make gist public (default)
.PP
.TP
\fB-u \fP\fIUSER\fP:PASSWORD
Change the GitHub account the gist will be posted under. A password can given as well with a separating colon, a prompt is provided if not.
.PP
.TP
\fB-U\fP
Post gist anonymously (default)
.PP
.TP
\fB-h\fP
Print help and exit
.PP
.TP
\fB-v\fP
Print version info and exit
.PP
.SH USAGE
.PP
Create a new gist of 'file.txt':
.PP
.RS 4
.EX
$ gst file.txt
https://gist.github.com/<new-id>
.EE
.RE
There is also support for multiple files in a single gist:
.PP
.RS 4
.EX
$ gst README.md Makefile prog.c
https://gist.github.com/<new-id>
.EE
.RE
Specify the gist's description:
.PP
.RS 4
.EX
$ gst -d 'a cool shell script' script.sh
https://gist.github.com/<new-id>
.EE
.RE
The gist's URL can be piped to other programs, for example to your clipboard to be pasted elsewhere:
.PP
.RS 4
.EX
$ gst file.txt | xsel -bi
.EE
.RE
You can also create a new gist from 'stdin'. The file name needs to be supplied however:
.PP
.RS 4
.EX
$ cmd-which-errors | gst -f log.txt
https://gist.github.com/<new-id>
.EE
.RE
The new gist can be posted under a GitHub user, a prompt will ask for your password:
.PP
.RS 4
.EX
$ gst -u your-name good-proj.rs
GitHub password:
https://gist.github.com/<new-id>
.EE
.RE
To skip the prompt your password can be supplied after a colon with the username:
.PP
.RS 4
.EX
$ gst -u your-name:password plugin/func.vim doc/func.txt
https://gist.github.com/<new-id>
.EE
.RE
New gists can be private when created under a user:
.PP
.RS 4
.EX
$ gst -p -u name personal.info
https://gist.github.com/<new-id>
.EE
.RE
You can also edit a previously created gist under your account, such as adding a new file or updating the description:
.PP
.RS 4
.EX
$ gst -e <id> -u name -d "new description" additional-file.txt
https://gist.github.com/<id>
.EE
.RE
It is even possible to delete files, although it should be noted the gist still exists even if you delete all the files within it due to the limitations of the API:
.PP
.RS 4
.EX
$ gst -e <id> -u name -D old.py
https://gist.github.com/<id>
.EE
.RE
.SH INSTALLATION
.PP
The only dependency needed to build gst is cURL. gst be compiled with a simple 'make' and 'sudo make install' will install the executable and man page.
.PP
.SH CUSTOMIZATION
.PP
gst can be customized by editing the custom 'config.h' and (re)compiling the source code. This keeps it fast, secure and simple. All customization can be done through the command line interface however, so basic aliases could also be utilized to change default options.
.PP
.SH AUTHOR
.PP
Ed van Bruggen <[email protected]>
.PP
.SH SEE ALSO
.PP
See project page at <https://edryd.org/projects/gst.html>
.PP
View source code at <https://git.edryd.org/gst>
.PP
.SH LICENSE
.PP
zlib License
.PP