aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Cholewiński <harry666t@gmail.com>2018-09-15 15:15:16 +0200
committerKamil Cholewiński <harry666t@gmail.com>2018-09-15 15:15:16 +0200
commit2ae07e3cfcbe0a150bbc163524f25d79b81f44ce (patch)
tree27b6c5adcecefc45df5c348f730c0b9c98ab6071
parentf9176edf260ba185e327f6b16cdb78b4d6c9d876 (diff)
downloadjudo-2ae07e3cfcbe0a150bbc163524f25d79b81f44ce.zip
judo-2ae07e3cfcbe0a150bbc163524f25d79b81f44ce.tar.gz
judo-2ae07e3cfcbe0a150bbc163524f25d79b81f44ce.tar.bz2
Add version test and bump to 0.4HEAD0.4master
-rw-r--r--main.go8
-rw-r--r--readme.md51
2 files changed, 34 insertions, 25 deletions
diff --git a/main.go b/main.go
index 639028e..9808ccf 100644
--- a/main.go
+++ b/main.go
@@ -13,11 +13,12 @@ import (
const usage = `usage:
judo [common flags] -s script [--] ssh-targets
judo [common flags] -c command [--] ssh-targets
- judo [-v | -h]
+ judo -v [required-version]
+ judo -h
common flags:
[-d] [-e KEY | KEY=VALUE] [-f n] [-t s]`
-const version = "judo 0.3-dev"
+const version = "0.4"
func parseArgs(args []string) (
job *Job, names []string, msg string,
@@ -38,6 +39,9 @@ func parseArgs(args []string) (
case "-h":
return nil, nil, usage, 0, nil
case "-v":
+ if len(names) > 0 && version != names[0] {
+ return nil, nil, version, 1, nil
+ }
return nil, nil, version, 0, nil
case "-s":
script, err = NewScript(opt.Arg())
diff --git a/readme.md b/readme.md
index 8f23bfd..14c0d01 100644
--- a/readme.md
+++ b/readme.md
@@ -471,40 +471,45 @@ send suggestions on improving the readme.
Sure! Send me bug reports, suggestions, diffs, hate mail and
accolades - as appropriate. Contact info below.
-Please do mind the following however:
+## Simplicity and stability
-- Judo is intentionally simple. It aims to have 90% of
- [Ansible's][ansible] core features, while having 1% of the code (or
- less). If Judo can't do something for you, you should investigate
- the following:
+Judo is intentionally simple. It aims to have 90% of
+[Ansible's][ansible] core features, while having 1% of the code (or
+less). If Judo can't do something for you, you should investigate the
+following:
- - Rethink your problem,
- - Look into using [Ansible][ansible] instead.
+- Rethink your problem,
+- Look into using [Ansible][ansible] instead.
[ansible]: https://www.ansible.com/
-- Integrations with specific OS's on remote targets are left to
- separate projects - barring the minimum needed to set up the remote
- execution environment. However, Judo should make it simple to
- bootstrap some sort of "rosetta stone" on the remote end.
+Integrations with specific OS's on remote targets are left to separate
+projects - barring the minimum needed to set up the remote execution
+environment. However, Judo should make it simple to bootstrap some
+sort of "rosetta stone" on the remote end.
-- The SLOC count of the entire source code (`grep -v '^$' $(find .
- -name "*.go") | wc -l`) shall never exceed 2000 lines.
+The dependencies, for building or for running, on control or on remote
+machines, shall never change.
-- The dependencies, for building or for running, on control or on
- remote machines, shall never change.
+When the 1.0 release appears, the feature set and the interface will
+be frozen until it's time for a 2.0. All (well written) scripts must
+continue working, unchanged. If 2.0 ever appears, well written scripts
+should require no adjustments at all.
-- When the 1.0 release appears, the feature set and the interface will
- be frozen until it's time for a 2.0. All (well written) scripts must
- continue working, unchanged. If 2.0 ever appears, well written
- scripts should require no adjustments at all.
+The time for 2.0 will not be after 1.9; 1.9 will be followed by 1.10
+and 1.11, all the way to 1.61, if necessary. Same for 2.x; expect 2.71
+before 3.0.
-- The time for 2.0 will not be after 1.9; 1.9 will be followed by 1.10
- and 1.11, all the way to 1.61, if necessary. Same for 2.x; expect
- 2.71 before 3.0.
+Testing for the required version number is made simple via an optional
+argument to the `-v` flag. In the 0.x series, it must be an exact
+version string match; past 1.0, it will specify the minimal required
+version. This feature was added in version 0.4, so as of today, only
+this will work:
+
+ judo -v 0.4
## Author
-&copy; 2016 Kamil Cholewiński <<kamil@rollc.at>>
+&copy; 2016-2018 Kamil Cholewiński <<kamil@rollc.at>>
License is [MIT](/license.txt).