libfossil
fcli_t Struct Reference

The fcli_t type, accessed by clients via the fcli global instance, contains various data for managing a basic Fossil SCM application build using libfossil. More...

#include "fossil-cli.h"

Data Fields

void(* appHelp )()
 Holds a help function callback which should output any app-specific help. More...
 
fcli_help_t const * appHelp2
 If not NULL, it must be a pointer to fcli_help_t holding help info for the app. More...
 
char const * appName
 Application's name. More...
 
int argc
 Current number of items in this->argv. More...
 
char ** argv
 The current list of CLI arguments. More...
 
char const * checkoutDir
 If not NULL then fcli_setup() will attempt to open the checkout for the given dir, including its associated repo db. More...
 
struct {
   fsl_outputer   outputer
 This output channel is used when initializing this->f. More...
 
   int   traceSql
 Whether or not to enable fossil's SQL tracing. More...
 
config
 Holds bits which can/should be configured by clients BEFORE calling fcli_setup(). More...
 
fsl_cxf
 The shared fsl_cx instance. More...
 
char fDryRun
 True if the –dry-run flag is seen during initial arguments processing. More...
 
struct {
   char   gmtTime
 Don't use this - it will likely go away. More...
 
   char   helpRequested
 Set to true if fcli_setup() detects -? or –help in the argument list, or if the first non-flag argument is "help". More...
 
   char *   repoDbArg
 fsl_malloc()'d repo db name string made by args processing. More...
 
transient
 Transient settings and flags. More...
 
int verbose
 A verbosity level counter. More...
 

Detailed Description

The fcli_t type, accessed by clients via the fcli global instance, contains various data for managing a basic Fossil SCM application build using libfossil.

Usage notes:

  • All non-const pointer members are owned and managed by the fcli API. Clients may reference them but must be aware of lifetimes if they plan to hold the reference for long.

Definition at line 166 of file fossil-cli.h.

Field Documentation

void(* fcli_t::appHelp) ()

Holds a help function callback which should output any app-specific help.

Should be set by client applications BEFORE calling fcli_setup() so that the fcli help subsystem can integrate the app. fcli.appName will be set by the time this is called.

Definition at line 174 of file fossil-cli.h.

fcli_help_t const* fcli_t::appHelp2

If not NULL, it must be a pointer to fcli_help_t holding help info for the app.

It will be formated and output when –help is triggered, in place of appHelp.

Definition at line 180 of file fossil-cli.h.

char const* fcli_t::appName

Application's name.

Currently argv[0] but needs to be adjusted for Windows platforms.

Definition at line 219 of file fossil-cli.h.

int fcli_t::argc

Current number of items in this->argv.

Definition at line 214 of file fossil-cli.h.

char** fcli_t::argv

The current list of CLI arguments.

This list gets modified by fcli_flag() and friends.

Definition at line 210 of file fossil-cli.h.

char const* fcli_t::checkoutDir

If not NULL then fcli_setup() will attempt to open the checkout for the given dir, including its associated repo db.

By default this is "." (the current directory).

Applications can set this to NULL _before_ calling fcli_setup() in order to disable the automatic attemp to open a checkout under the current directory. Doing so is equivalent to using the –no-checkout|-C flags.

Definition at line 205 of file fossil-cli.h.

struct { ... } fcli_t::config

Holds bits which can/should be configured by clients BEFORE calling fcli_setup().

fsl_cx* fcli_t::f

The shared fsl_cx instance.

It gets initialized by fcli_setup() and cleaned up post-main().

this->f is owned by this object and will be cleaned up at app shutdown (post-main).

Definition at line 188 of file fossil-cli.h.

char fcli_t::fDryRun

True if the –dry-run flag is seen during initial arguments processing.

fcli does not use this itself - it is intended as a convenience for applications. Those which want to support a short-form flag can implement that like this:

char dryRun = fcli.fDryRun ? fcli.fDryRun :
fcli_flag("n", NULL);

Definition at line 232 of file fossil-cli.h.

char fcli_t::gmtTime

Don't use this - it will likely go away.

The following text was at some point true but is currently a lie:

If the –gmt flag is found, this is set to true. That causes the FSL_CX_F_LOCALTIME_GMT flag to be set on this->f.

Definition at line 255 of file fossil-cli.h.

char fcli_t::helpRequested

Set to true if fcli_setup() detects -? or –help in the argument list, or if the first non-flag argument is "help".

Definition at line 247 of file fossil-cli.h.

fsl_outputer fcli_t::outputer

This output channel is used when initializing this->f.

The default implementation uses fsl_outputer_FILE to output to stdout.

Definition at line 274 of file fossil-cli.h.

char* fcli_t::repoDbArg

fsl_malloc()'d repo db name string made by args processing.

Definition at line 242 of file fossil-cli.h.

int fcli_t::traceSql

Whether or not to enable fossil's SQL tracing.

This should start with a negative value, which helps fcli_process_args() process it. Setting this after initialization has no effect.

Definition at line 268 of file fossil-cli.h.

struct { ... } fcli_t::transient

Transient settings and flags.

These are bits which are used during (or very shortly after) fcli_setup() but have no effect if modified after that.

int fcli_t::verbose

A verbosity level counter.

Starts at 0 (no verbosity) and goes up for higher verbosity levels. Currently levels 1 and 2 are intended for app-level use and level 3 for library-level use.

Definition at line 194 of file fossil-cli.h.


The documentation for this struct was generated from the following file: