libdballe  9.11
Classes | Macros | Functions
cmdline.h File Reference

Common functions for commandline tools. More...

#include <wreport/error.h>
#include <dballe/file.h>
#include <dballe/fwd.h>
#include <popt.h>
#include <memory>
#include <vector>
#include <list>
#include <string>

Go to the source code of this file.

Classes

struct  dballe::cmdline::Subcommand
 
struct  dballe::cmdline::Command
 
struct  dballe::cmdline::error_cmdline
 Report an error with command line options. More...
 

Macros

#define ODT_END   { NULL, NULL, NULL, NULL, NULL, NULL }
 

Functions

void dballe::cmdline::dba_cmdline_print_dba_error ()
 Print informations about the last error to stderr.
 
void dballe::cmdline::dba_cmdline_error (poptContext optCon, const char *fmt,...) __attribute__((format(printf
 Print an error that happened when parsing commandline arguments, then add usage informations and exit.
 
void Encoding dballe::cmdline::string_to_encoding (const char *type)
 Return the File::Encoding that corresponds to the name in the string.
 
unsigned dballe::cmdline::dba_cmdline_get_query (poptContext optCon, Query &query)
 Get a DB-ALLe query from commandline parameters in the form key=value. More...
 
void dballe::cmdline::list_templates ()
 List available output templates.
 
std::list< std::string > dballe::cmdline::get_filenames (poptContext optCon)
 Read all the command line arguments and return them as a list.
 

Detailed Description

Common functions for commandline tools.

Function Documentation

◆ dba_cmdline_get_query()

unsigned dballe::cmdline::dba_cmdline_get_query ( poptContext  optCon,
Query query 
)

Get a DB-ALLe query from commandline parameters in the form key=value.

Returns
the number of key=value pairs found