Hi Ben,
Please check out the changes to epicsReadline in 3.16 (I think the code in 7.0 is the same but I might be wrong and that was where I did the work instead of 3.16). Your work may need some changes but I think the newer API may be what you’re looking for.
The RTEMS targets also have support for a library called libtecla which I believe provides some/similar functionality but I don’t know exactly what — Eric Norum added that way back.
What is the license for linenoise? I have heard of it and it sounds like it might be a good fit.
- Andrew
--
Sent from my iPad
> On Feb 9, 2018, at 10:55 AM, Benjamin Franksen <[email protected]> wrote:
>
> Hi Everyone
>
> I have just finished an experimental addition to EPICS base and wondered
> if you might be interested. It began when I investigated building our
> RTEMS IOCs statically -- presumably the way most people use RTEMS with
> EPICS -- instead of using cexpsh and gesys and then loading modules at
> runtime as we used to. So I am now stuck with the iocsh and found that I
> missed things like command line completion and history.
>
> The code in base (I haven't yet look at versions beyond 3.14) has a very
> simple API (epicsReadline.h) for accessing the command line library
> chosen by the user (by setting COMMANDLINE_LIBRARY). The wrapper code
> (epicsReadline.c) is a bit messy/repetitive (#if ...# elif...) but
> otherwise not hard to grok. It assume the COMMANDLINE_LIBRARY is
> pre-installed system-wide, though. This is a pain, especially with
> RTEMS, but also with various other host systems, see recurring questions
> on tech-talk about libreadline in various versions, with or without
> libcurses or libncurses. And as it turns out, almost none of the
> advanced features offered by libreadline are used in the iocsh.
>
> I looked around a bit and found a very nice and small library named
> linenoise [1]. It has all the features, compiles against (and actually
> works on, with a few minor modifications) RTEMS (only tested 4.9 so
> far), and has no more than 820 lines of code (without comments,
> according to cloc [2]). It has been expressly designed for being
> bundled. So I added a copy to base and wrote the epicsReadline wrapper
> code for it, adding another variant for COMMANDLINE_LIBRARY. In
> addition, with a few additional lines of code in the wrapper for
> linenoise I was able to implement command completion as well as argument
> hints.
>
> I think bundling linenoise with base and making it the default command
> line library for the iocsh (except on vxWorks which apparently has no
> termios) would be smart move. If there is interest, I can submit patches
> (merge request, whatever) against the launchpad repo.
>
> Another solution would be to change the epicsReadline API in such a way
> that an EPICS support module can replace the three exported functions
> with another implementation; this could be done inside the main
> function, for instance.
>
> [1] https://github.com/antirez/linenoise
> [2] https://github.com/AlDanial/cloc
>
> Cheers
> Ben
> --
> "Make it so they have to reboot after every typo." ― Scott Adams
>
- Replies:
- Re: bundling linenoise with base Eric Norum
- Re: bundling linenoise with base Benjamin Franksen
- References:
- bundling linenoise with base Benjamin Franksen
- Navigate by Date:
- Prev:
bundling linenoise with base Benjamin Franksen
- Next:
Re: bundling linenoise with base Eric Norum
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
<2018>
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
bundling linenoise with base Benjamin Franksen
- Next:
Re: bundling linenoise with base Eric Norum
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
<2018>
2019
2020
2021
2022
2023
2024
|