aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordvs12024-11-04 15:40:51 +1000
committerdvs12024-11-04 15:40:51 +1000
commit4f20915996f62a4890c315138a250a5a42d28877 (patch)
tree6dee2c013571beea2f8839a3577ea70e66fb25b2
parentOops-- (diff)
downloadJackOnAllDevices-4f20915996f62a4890c315138a250a5a42d28877.zip
JackOnAllDevices-4f20915996f62a4890c315138a250a5a42d28877.tar.gz
JackOnAllDevices-4f20915996f62a4890c315138a250a5a42d28877.tar.bz2
JackOnAllDevices-4f20915996f62a4890c315138a250a5a42d28877.tar.xz
Search for the README.md file when help is asked for.
-rwxr-xr-xPolygLua.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/PolygLua.lua b/PolygLua.lua
index 5305872..e4cf6db 100755
--- a/PolygLua.lua
+++ b/PolygLua.lua
@@ -42,6 +42,16 @@ local optionsCommon =
42{ 42{
43 help = {help = 'Print the help text.', 43 help = {help = 'Print the help text.',
44 func = function(self, options, a, args, i) 44 func = function(self, options, a, args, i)
45 for i,v in ipairs{'/usr/share/doc/', '/usr/local/share/doc/', './'} do
46 local p = v .. 'README.md'
47 local h = io.open(p, 'r')
48 if nil ~= h then
49 D('Found README file '.. p)
50 Help = h:read('*a')
51 h:close()
52 end
53 end
54
45 print(Help) 55 print(Help)
46 _.usage(args, options, true) 56 _.usage(args, options, true)
47 os.exit(0) 57 os.exit(0)