Skip to content

Commit b108c9d

Browse files
author
Artur Kh
committed
Rename ConfigNew() to NewConfig()
1 parent 94fb7c0 commit b108c9d

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type Config struct {
1616
file string
1717
}
1818

19-
func ConfigNew() *Config {
19+
func NewConfig() *Config {
2020
c := &Config{}
2121
c.Load()
2222
return c

config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import "testing"
44

55
func TestConfigUpdate(t *testing.T) {
6-
c := ConfigNew()
6+
c := NewConfig()
77

88
origApiKey := c.Token
99
newApiKey := "newkey"

go-gist.go

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,40 @@ const (
1515
DefaultGistName = "a"
1616
)
1717

18-
var config = ConfigNew()
18+
var config = NewConfig()
1919

2020
func main() {
2121
config.Load()
2222

23+
// usage := `go-gist
24+
//
25+
//go-gist lets you upload to https://gist.github.com/. Go clone of the official Gist client.
26+
//
27+
//Usage:
28+
// go-gist (-o|-c|-e) [-p] [-s] [-R] [-d DESC] [-a] [-u URL] [-P] (-f NAME | -t EXT) FILE...
29+
// go-gist --login
30+
//
31+
//Options:
32+
// --login Authenticate gist on this computer.
33+
// -f NAME --filename=NAME Sets the filename and syntax type.
34+
// -t EXT --type=EXT Sets the file extension and syntax type.
35+
// -p --private Indicates whether the gist is private.
36+
// -d DESC --description=DESC Adds a description to your gist.
37+
// -s --shorten *Shorten the gist URL using git.io.
38+
// -u URL --update=URL Update an existing gist.
39+
// -a --anonymous Create an anonymous gist.
40+
// -c --copy Copy the resulting URL to the clipboard.
41+
// -e --embed *Copy the embed code for the gist to the clipboard.
42+
// -o --open *Open the resulting URL in a browser.
43+
// -P --paste Paste from the clipboard to gist.
44+
// -R --raw *Display raw URL of the new gist.
45+
// -l USER --list=USER Lists all gists for a user.
46+
// -h --help Show this help message and exit.
47+
// --version Show version and exit.`
48+
//
49+
// arguments, err := docopt.Parse(usage, nil, true, "go-gist "+VERSION, false)
50+
// fmt.Println(arguments)
51+
2352
anonymousFlag := flag.Bool("a", false, "Create an anonymous gist.")
2453
copyFlag := flag.Bool("c", false, "Copy the resulting URL to the clipboard.")
2554
listFlag := flag.Bool("l", false, "List gists.")

0 commit comments

Comments
 (0)