37:e7e650632cc8
Anton Shestakov <av6@dwimlabs.net>, Sun, 23 Oct 2016 17:53:32 +0800
hglib: make inner loop in runcommand() use a coroutine Then it's possible to do something nontrivial using the more low-level client.runcommand_co().

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