Browse Source

Add version info

Brett Langdon 9 years ago
parent
commit
80102feb2b
No known key found for this signature in database GPG Key ID: A2ECAB73CE12147F
2 changed files with 8 additions and 0 deletions
  1. +5
    -0
      config.go
  2. +3
    -0
      version.go

+ 5
- 0
config.go View File

@ -1,6 +1,7 @@
package pypihub package pypihub
import ( import (
"fmt"
"os" "os"
"strings" "strings"
@ -14,6 +15,10 @@ type Config struct {
Bind string `arg:"-b,--bind,env:PYPIHUB_BIND,help:[<address>]:<port> to bind the server to (default: ':8287') (env: PYPIHUB_BIND)"` Bind string `arg:"-b,--bind,env:PYPIHUB_BIND,help:[<address>]:<port> to bind the server to (default: ':8287') (env: PYPIHUB_BIND)"`
} }
func (c Config) Version() string {
return fmt.Sprintf("pypihub %s", VERSION)
}
func ParseConfig() Config { func ParseConfig() Config {
var config = Config{ var config = Config{
Bind: ":8287", Bind: ":8287",


+ 3
- 0
version.go View File

@ -0,0 +1,3 @@
package pypihub
const VERSION = "0.1.0"

Loading…
Cancel
Save