Skip to content

Commit

Permalink
v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
miku committed Mar 16, 2018
1 parent e358125 commit b16b453
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions cmd/rsampling/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ import (
"time"
)

const Version = "0.2.0"

var (
size = flag.Int("n", 16, "number of samples to obtain")
seed = flag.Int64("r", int64(time.Now().Nanosecond()), "random seed")
size = flag.Int("n", 16, "number of samples to obtain")
seed = flag.Int64("r", int64(time.Now().Nanosecond()), "random seed")
version = flag.Bool("version", false, "show program version")
)

// Reservoir for strings.
Expand Down Expand Up @@ -93,6 +96,10 @@ func (r *Reservoir) Add(s string) {

func main() {
flag.Parse()
if *version {
fmt.Println(Version)
os.Exit(0)
}
rand.Seed(*seed)
rr := NewReservoirSize(*size)
br := bufio.NewReader(os.Stdin)
Expand Down
2 changes: 1 addition & 1 deletion packaging/deb/rsampling/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: rsampling
Version: 0.1.0
Version: 0.2.0
Section: utils
Priority: optional
Architecture: amd64
Expand Down
2 changes: 1 addition & 1 deletion packaging/rpm/rsampling.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Summary: Reservoir sampling for the command line.
Name: rsampling
Version: 0.1.0
Version: 0.2.0
Release: 0
License: GPLv3
BuildArch: x86_64
Expand Down

0 comments on commit b16b453

Please sign in to comment.