]> thyrsus.com Git - src.git/commitdiff
Added src version.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 10 Nov 2014 23:16:43 +0000 (18:16 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 10 Nov 2014 23:16:43 +0000 (18:16 -0500)
NEWS
src
src.asc

diff --git a/NEWS b/NEWS
index 64190f4ce912a1fe32b73141b728dd9ac1fa5833..6a0d455eca573103cc5c86864a6393e327ed5a34 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
 `                      src project news
 
 Repository head:
+   Added src version.
    'U' (unmodified) becomes '.' in src status listings.
 
 0.4: 2014-11-10
diff --git a/src b/src
index 828116ba6d6d186f67fac404492210aa3ed6c3d9..4f004da62497305a8ea8f2b77c9240846bb9dc65 100755 (executable)
--- a/src
+++ b/src
@@ -296,6 +296,9 @@ src release ['file'...]
    have to interoperate with other tools that expect RCS masters to be
    in their normal (unlocked) stare.
 
+src version
+   Report the version of src.
+
 The omission of 'src remove' is a deliberate speed bump.
 """
 
@@ -859,6 +862,10 @@ def fast_import_method(*args):
         os.rename(fn, corresponding)
     shutil.rmtree("RCS")
 
+def version_method(*args):
+    "Report SRC's version"
+    sys.stdout.write("%s\n" % version)
+
 dispatch = {
     "help":        help_method,
     "add":         add_method,
@@ -883,6 +890,7 @@ dispatch = {
     "fast-export": fast_export_method,
     "fast-import": fast_import_method,
     "release":     release_method,
+    "version":     version_method,
 }
 
 class RCS:
diff --git a/src.asc b/src.asc
index 1fab86108505484ae2f038cff6feb09828e80e75..15462ee64323a8cbabb5b10b91b4786793ba74c8 100644 (file)
--- a/src.asc
+++ b/src.asc
@@ -121,6 +121,9 @@ src release ['file'...]::
    have to interoperate with other tools that expect RCS masters to be
    in their normal (unlocked) stare.
 
+src version::
+   Report the version of src.
+
 The omission of 'src remove' is a deliberate speed bump.
 
 If no files are specified, all eligible files are operated on in sequence.