Download:
child 18:3702d11e0309
parent 16:42df16aab3fc
17:265967da3bcb
Anton Shestakov <av6@dwimlabs.net>, Sat, 10 Sep 2016 07:56:45 +0800
examples: version.lua

1 файлов изменено, 15 вставок(+), 0 удалений(-) [+]
examples/version.lua file | annotate | diff | comparison | revisions
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/version.lua Sat Sep 10 07:56:45 2016 +0800
@@ -0,0 +1,15 @@
+local hglib = require('hglib')
+
+local client = hglib.Client.open()
+
+local code, o, e, d = client:runcommand('version', '--quiet')
+client:close()
+
+if code == 0 then
+ print(o:match('%(version (%S+)%)'))
+else
+ print("Couldn't get version: " .. e)
+end
+if #d > 0 then
+ print('Debug: ')
+end