Skip to content

Commit

Permalink
Merge branch 'release/0.5' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
cyfdecyf committed Dec 25, 2012
2 parents dbaf605 + 9f26f09 commit cc590e3
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
table.cache
7 changes: 7 additions & 0 deletions cmd/shadowsocks-local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ func enoughOptions(config *ss.Config) bool {
func main() {
var configFile, cmdServer string
var cmdConfig ss.Config
var printVer bool

flag.BoolVar(&printVer, "version", false, "print version")
flag.StringVar(&configFile, "c", "config.json", "specify config file")
flag.StringVar(&cmdServer, "s", "", "server address")
flag.StringVar(&cmdConfig.Password, "k", "", "password")
Expand All @@ -287,6 +289,11 @@ func main() {

flag.Parse()

if printVer {
ss.PrintVersion()
os.Exit(0)
}

cmdConfig.Server = cmdServer
ss.SetDebug(debug)

Expand Down
8 changes: 8 additions & 0 deletions cmd/shadowsocks-server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,14 +354,22 @@ var config *ss.Config

func main() {
var cmdConfig ss.Config
var printVer bool

flag.BoolVar(&printVer, "version", false, "print version")
flag.StringVar(&configFile, "c", "config.json", "specify config file")
flag.StringVar(&cmdConfig.Password, "k", "", "password")
flag.IntVar(&cmdConfig.ServerPort, "p", 0, "server port")
flag.IntVar(&cmdConfig.Timeout, "t", 60, "connection timeout (in seconds)")
flag.BoolVar((*bool)(&debug), "d", false, "print debug message")

flag.Parse()

if printVer {
ss.PrintVersion()
os.Exit(0)
}

ss.SetDebug(debug)

var err error
Expand Down
6 changes: 6 additions & 0 deletions shadowsocks/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ package shadowsocks

import (
"errors"
"fmt"
"os"
)

func PrintVersion() {
const version = "0.5"
fmt.Println("shadowsocks-go version", version)
}

func IsFileExists(path string) (bool, error) {
stat, err := os.Stat(path)
if err == nil {
Expand Down
11 changes: 6 additions & 5 deletions win32build.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
set GOPATH=%cd%
go install local
go install server
go install test

pushd cmd\shadowsocks-local
go install
popd
pushd cmd\shadowsocks-server
go install
popd

0 comments on commit cc590e3

Please sign in to comment.