diff --git a/cmd/rsampling/main.go b/cmd/rsampling/main.go index 3e486bc..ce06b08 100644 --- a/cmd/rsampling/main.go +++ b/cmd/rsampling/main.go @@ -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. @@ -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) diff --git a/packaging/deb/rsampling/DEBIAN/control b/packaging/deb/rsampling/DEBIAN/control index bcc4475..c396f69 100644 --- a/packaging/deb/rsampling/DEBIAN/control +++ b/packaging/deb/rsampling/DEBIAN/control @@ -1,5 +1,5 @@ Package: rsampling -Version: 0.1.0 +Version: 0.2.0 Section: utils Priority: optional Architecture: amd64 diff --git a/packaging/rpm/rsampling.spec b/packaging/rpm/rsampling.spec index bab99e9..bb5a40d 100644 --- a/packaging/rpm/rsampling.spec +++ b/packaging/rpm/rsampling.spec @@ -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