libfossil  Artifact Content

Artifact 7e1cb9fc7d53c0490b498ae8ae2182c2056bec02:

Wiki page [FossilApp] by stephan 2014-02-11 14:36:06.
D 2014-02-11T14:36:06.290
L FossilApp
P dd1b3da11a4f3cc3b027d40afd29d538bfce1fef
U stephan
W 1378
<h1>fcli (formerly FossilApp)</h1>

<tt>[/finfo?name=include/fossil-scm/fossil-cli.h|fcli]</tt> provides a small framework for building applications which work with a single checkout and/or repository database. It provides a number of simplifications/services to applications:

   *  Initialization and cleanup of a shared Fossil context and its databases. It automatically opens a checkout under the current directory (like fossil(1) does) unless told not to (via the <tt>--no-checkout|-C</tt> CLI flags or equivalent C code).
   *  Unified CLI argument handling.
   *  Optional dispatch-by-command-name support.
   *  A basic help system.
   *  Installs a memory allocator which crashes on OOM, reducing error checking for this very common use case which very rarely fails in practice (and if it does, you probably have bigger problems than a crashed fossil app).

It is primarily intended for use by test/demo apps but there's little reason it cannot be used with "real" apps as well, and it is generally designed to be agnostic as to the actual type of app it's running under. It uses libfossil's output mechanism for output, so it could just as easily be plugged in to a GUI which directs the output to a text view widget, socket, external application (via a pipe), or similar.

See the [f-tools] page for a list of apps which demonstrate how to use/abuse fcli.
Z e96b002db59d9a7036de83934b4fceed