Skip to content
CLIgen is a Command-Line Interface generator
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build-root/scripts
extras
.gitignore
CHANGELOG.md Made Makefile concurrent so that it can be compiled with -jN Mar 21, 2019
Doxyfile documentation with doxygen Oct 9, 2015
LICENSE.md
Makefile.in
README.md Optimized cligen parser wrt strings Feb 21, 2019
cligen.h
cligen_buf.c
cligen_buf.h
cligen_buf_internal.h
cligen_config.h.in * Removed CLIGEN_COMPAT_INT (finally) Mar 18, 2019
cligen_custom.h
cligen_cv.c * Removed CLIGEN_COMPAT_INT (finally) Mar 18, 2019
cligen_cv.h * Removed CLIGEN_COMPAT_INT (finally) Mar 18, 2019
cligen_cv_internal.h 2019 Jan 2, 2019
cligen_cvec.c
cligen_cvec.h 2019 Jan 2, 2019
cligen_cvec_internal.h
cligen_expand.c
cligen_expand.h 2019 Jan 2, 2019
cligen_file.c 2019 Jan 2, 2019
cligen_gen.c * Added saving of CLI command history between sessions on file and so… Mar 8, 2019
cligen_gen.h
cligen_getline.c
cligen_getline.h * Added saving of CLI command history between sessions on file and so… Mar 8, 2019
cligen_handle.c
cligen_handle.h * Added saving of CLI command history between sessions on file and so… Mar 8, 2019
cligen_handle_internal.h
cligen_hello.c 2019 Jan 2, 2019
cligen_history.c * Added saving of CLI command history between sessions on file and so… Mar 8, 2019
cligen_history.h
cligen_history_internal.h
cligen_io.c
cligen_io.h
cligen_match.c
cligen_match.h 2019 Jan 2, 2019
cligen_parse.h
cligen_parse.l
cligen_parse.y
cligen_print.c * Added support for multiple range and length statements for number a… Mar 4, 2019
cligen_print.h 2019 Jan 2, 2019
cligen_read.c
cligen_read.h 2019 Jan 2, 2019
cligen_syntax.c
cligen_syntax.h
cligen_tutorial.c 2019 Jan 2, 2019
cligen_tutorial.pdf * Added support for multiple range and length statements for number a… Mar 4, 2019
cligen_tutorial.tex
cligen_util.c
cligen_util.h 2019 Jan 2, 2019
config.guess cbuf .h + modernized config-scripts Oct 1, 2014
config.sub cbuf .h + modernized config-scripts Oct 1, 2014
configure
configure.ac * Removed CLIGEN_COMPAT_INT (finally) Mar 18, 2019
install-sh
tutorial.cli 2019 Jan 2, 2019
usage.pdf

README.md

CLIgen

CLIgen is a Command-Line Interface generator.

Well, actually it is not really a generator, since it does not generate code for CLI:s. Instead, it builds and interprets datastructures (a parse-tree) which a library (libcligen) interprets in runtime. It is fast and efficient and helps you develop CLI:s easier. You enter a CLI syntax either in a text file, you write callback functions where you call the right library routines. The callback functions add the semantics, that is, what the commands in the CLI are supposed to do.

Presentations and tutorial is found on the CLIgen project page

CLIgen is not a system in itself, you need to build your own 'backend'. We have started another project: 'clixon' which is actually a whole system where you load dynamic frontend and backend modules CLIXON project page and CLIXON github. Clixon provides a system, with embedded database, commit semantics, YANG and NETCONF interface, etc. CLIgen is a part of clixon.

The source code here is built and installed using:

  configure;
  make;
  sudo make install.

The source builds a single library. If you build applications, you should include cligen.h and link with the library.

There are several example applications:

  • cligen_hello Simplest possible. Just builds a 'hello world' greeting by in-line C
  • cligen_file Read a syntax specification from file. You must supply the file.
  • cligen_tutorial Samples of techniques used in cligen_tutorial.pdf.

See also Changelog.

CLIgen is dual license. Either Apache License, Version 2.0 or GNU General Public License Version 2. You choose.

I can be found at olof@hagsand.se.

getline

CLIgen uses getline with the following copyright:

Copyright (C) 1991, 1992, 1993 by Chris Thewalt (thewalt@ce.berkeley.edu)

Permission to use, copy, modify, and distribute this software for any purpose and without fee is hereby granted, provided that the above copyright notices appear in all copies and that both the copyright notice and this permission notice appear in supporting documentation. This software is provided "as is" without express or implied warranty.

You can’t perform that action at this time.