33:40f83ed9b472
Anton Shestakov <av6@dwimlabs.net>, Fri, 16 Sep 2016 15:50:45 +0800
spec: exit codes are not very useful, check them last Error and output channels usually have readable messages explaining what went wrong, they need to be checked first.

previous change 30:c89104014973

examples/version.lua

Permissions: -rw-r--r--

Other formats: Feeds:
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