-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #1
- Loading branch information
Showing
6 changed files
with
168 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,28 @@ | ||
# github-stats | ||
Command-line tool to get the total traffics statistics on your GitHub account | ||
|
||
## How To Use | ||
|
||
```bash | ||
github-stats --token A_Valid_Personal_Access_Token | ||
``` | ||
|
||
For details please use `--help` as argument; | ||
|
||
```bash | ||
$ go run main.go --help | ||
NAME: | ||
github-stats - Get the total visit stats of your GitHub repositories | ||
USAGE: | ||
github-stats [global options] | ||
AUTHOR: | ||
Umut Işık <[email protected]> | ||
OPTIONS: | ||
--day value, -d value The number of days from today to show the stats (default: 0) | ||
--verbose value, -v value Show verbose output or not. 1 for verbose. Default is 0 (default: 0) | ||
--token value, -t value Personal access token got from GitHub to use the API | ||
``` | ||
|
||
## How To Contribute | ||
|
||
All kind of contributions are ok for me :). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package app | ||
|
||
import ( | ||
ucli "github.com/urfave/cli/v2" | ||
) | ||
|
||
func New() *ucli.App { | ||
app := &ucli.App{ | ||
Name: "github-stats", | ||
Usage: "Get the total visit stats of your GitHub repositories", | ||
UsageText: "github-stats [global options]", | ||
Authors: []*ucli.Author{ | ||
{Name: "Umut Işık", Email: "[email protected]"}, | ||
}, | ||
Flags: []ucli.Flag { | ||
&ucli.IntFlag{ | ||
Name: "day", | ||
Aliases: []string{"d"}, | ||
Usage: "The number of days from today to show the stats", | ||
Value: 0, | ||
}, | ||
&ucli.IntFlag{ | ||
Name: "verbose", | ||
Aliases: []string{"v"}, | ||
Usage: "Show verbose output or not. 1 for verbose. Default is 0", | ||
Value: 1, | ||
}, | ||
&ucli.StringFlag{ | ||
Name: "token", | ||
Aliases: []string{"t"}, | ||
Value: "", | ||
Usage: "Personal access token got from GitHub to use the API", | ||
Required: true, | ||
}, | ||
}, | ||
} | ||
|
||
app.CustomAppHelpTemplate = ` | ||
NAME: | ||
{{.Name}}{{if .Usage}} - {{.Usage}}{{end}} | ||
USAGE: | ||
{{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}} {{if .VisibleFlags}}[global options]{{end}}{{if .Commands}} command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}{{if .Version}}{{if not .HideVersion}} | ||
VERSION: | ||
{{.Version}}{{end}}{{end}}{{if .Description}} | ||
DESCRIPTION: | ||
{{.Description}}{{end}}{{if len .Authors}} | ||
AUTHOR{{with $length := len .Authors}}{{if ne 1 $length}}S{{end}}{{end}}: | ||
{{range $index, $author := .Authors}}{{if $index}} | ||
{{end}}{{$author}}{{end}}{{end}}{{if .VisibleCommands}} | ||
OPTIONS: | ||
{{range $index, $option := .VisibleFlags}}{{if $index}} | ||
{{end}}{{$option}}{{end}}{{end}}{{if .Copyright}} | ||
COPYRIGHT: | ||
{{.Copyright}}{{end}} | ||
` | ||
|
||
return app | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters