blob: d3fff0ff9bbb70822f71c33f3e5c3fbd6ab8f212 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
--[[
Copyright (c) 2012-2013 Kaarle Ritvanen
See LICENSE file for license details
--]]
module(..., package.seeall)
local pth = require('acf.path')
local map = require('acf.util').map
backend = require('acf.object').class()
function backend:init() self.aug = require('augeas').init() end
function backend:get(path, tpe)
path = pth.join('/', unpack(path))
local _, count = self.aug:match(path)
if count == 0 then return end
local value = self.aug:get(path)
if value ~= nil then return value end
return map(pth.name, self.aug:match(path..'/*'))
end
-- TODO implement set function
|