Commit 56d8fe92 authored by Peter Billam's avatar Peter Billam

1.4 handles missing .fen file in a more user-friendly way

parent 2c67f5cb
......@@ -5,7 +5,7 @@
-- This script is free software; you can redistribute it and/or --
-- modify it under the same terms as Lua5 itself. --
---------------------------------------------------------------------
local Version = '1.3 for Lua5'
local Version = '1.4 for Lua5'
local VersionDate = '28jun2018';
local Synopsis = [[
fen2img [-w 350] \
......@@ -63,7 +63,8 @@ Fenstr = arg[iarg]
if not Fenstr then die('must specify FEN string') end
-- if Fenstr ends in .fen and exists as a file then it should be read as a file
if string.match(Fenstr, '%.fen$') then
local fenfh = assert(io.open(Fenstr, 'r'))
local fenfh, msg = io.open(Fenstr, 'r')
if not fenfh then die(msg) end
Fenstr = string.gsub(fenfh:read('a'), '%s+$', '')
io.close(fenfh)
end
......@@ -471,6 +472,7 @@ which you move into C</usr/share/fonts/truetype/>
=head1 CHANGES
20180628 1.4 handles missing .fen file in a more user-friendly way
20180628 1.3 now works also on a t.fen file
20180627 1.2 introduce the -f Flip option
20180627 1.1 allows output on stdout, for piping into display
......
......@@ -106,7 +106,8 @@ It also needs a particular TrueType font:</p>
</p>
<H3 id="CHANGES">CHANGES</H3>
<PRE> 20180628 1.3 now works also on a t.fen file
<PRE> 20180628 1.4 handles missing .fen file in a more user-friendly way
20180628 1.3 now works also on a t.fen file
20180627 1.2 introduce the -f Flip option
20180627 1.1 allows output on stdout, for piping into display
20180411 1.0 first working version
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment