Disk ARchive  2.4.21
Files | Enumerations | Functions
CMDLINE

Files

file  command_line.hpp
 contains routing in charge of the command-line and included files parsing
 
file  config_file.hpp
 specific routines to manages included files's targets
 
file  crit_action_cmd_line.hpp
 contains routines to convert command-line overwriting criterium to their crit_action counterparts
 
file  dar.hpp
 main module for dar command-line tool
 
file  dar_suite.hpp
 contains routine to manage CLI's common initialization and ultimate exception catching
 
file  getopt_decision.h
 switch routine to define which file to include based on the result of the configure script
 
file  hide_file.hpp
 contains class of base to split files in words
 
file  line_tools.hpp
 a set of general command line targeted routines
 
file  my_getopt_long.h
 may lead to the definition of getopt_long to solve declaration conflicts in <unistd.h> and <getopt.h>
 
file  no_comment.hpp
 contains class that transparently strips out the comments from configuration file
 
file  shell_interaction.hpp
 user_interaction class for command_line tools
 

Enumerations

enum  operation {
  noop, extract, create, diff,
  test, listing, isolate, merging,
  version_or_help
}
 
enum  dirty_behavior { dirtyb_ignore, dirtyb_warn, dirtyb_ok }
 

Functions

bool get_args (user_interaction &dialog, const char *home, const vector< string > &dar_dcf_path, const vector< string > &dar_duc_path, S_I argc, char *const argv[], line_param &param)
 main routine to extract parameters from command-line and included files
 
std::string crit_action_canonize_string (const std::string &argument)
 canonizes a criterium description string More...
 
const libdar::crit_actioncrit_action_create_from_string (libdar::user_interaction &dialog, const std::string &argument, const libdar::infinint &hourshift)
 creates a criterium object as defined by the command line's given string More...
 
const char * dar_version ()
 
void dar_suite_reset_signal_handler ()
 
int dar_suite_global (int argc, char *const argv[], const char **env, const char *getopt_string, char stop_scan, int(*call)(user_interaction &dialog, int, char *const [], const char **env))
 
std::string dar_suite_command_line_features ()
 
void line_tools_slice_ownership (const std::string &cmd, std::string &slice_permission, std::string &slice_user_ownership, std::string &slice_group_ownership)
 
void line_tools_repeat_param (const std::string &cmd, infinint &repeat_count, infinint &repeat_byte)
 
void line_tools_tlv_list2argv (user_interaction &dialog, const tlv_list &list, argc_argv &arg)
 
S_I line_tools_reset_getopt ()
 returns the old position of parsing (next argument to parse)
 
std::string::const_iterator line_tools_find_first_char_out_of_parenth (const std::string &argument, unsigned char to_find)
 
std::string::const_iterator line_tools_find_last_char_out_of_parenth (const std::string &argument, unsigned char to_find)
 
std::string line_tools_expand_user_comment (const std::string &user_comment, S_I argc, char *const argv[])
 
std::vector< std::string > line_tools_explode_PATH (const char *the_path)
 split a PATH environement variable string into its components (/usr/lib:/lib => /usr/lib /lib)
 
std::string line_tools_get_full_path_from_PATH (const std::vector< std::string > &the_path, const char *filename)
 return the full path of the given filename (eventually unchanged of pointing to the first file of that name present in the_path directories
 
void line_tools_split_at_first_space (const char *field, std::string &before_space, std::string &after_space)
 return split at the first space met the string given as first argument, and provide the two splitted string as second and third argument
 
void line_tools_get_min_digits (std::string arg, infinint &num, infinint &ref_num, infinint &aux_num)
 
void line_tools_look_for (const std::vector< char > &arguments, S_I argc, char *const argv[], const char *getopt_string, char stop_scan, std::vector< char > &presence)
 
void line_tools_look_for_jQ (S_I argc, char *const argv[], const char *getopt_string, char stop_scan, bool &j_is_present, bool &Q_is_present)
 
user_interactionshell_interaction_init (ostream *out, ostream *interact, bool silent)
 
void shell_interaction_change_non_interactive_output (ostream *out)
 
void shell_interaction_read_char (char &a)
 
void shell_interaction_close ()
 
void shell_interaction_set_beep (bool mode)
 

Detailed Description

Function Documentation

§ crit_action_canonize_string()

std::string crit_action_canonize_string ( const std::string &  argument)

canonizes a criterium description string

Parameters
[in]argumentis a not canonized criterium description string
Returns
a canonized description string
Note
criterium description strings when not canonized may include spaces tabs and carriage return for readability. Canonizing a criterium description string is to remove all these non significant characters.

§ crit_action_create_from_string()

const libdar::crit_action* crit_action_create_from_string ( libdar::user_interaction dialog,
const std::string &  argument,
const libdar::infinint hourshift 
)

creates a criterium object as defined by the command line's given string

Parameters
[in]dialogfor user interaction
[in]argumentis a canonized criterium argument
[in]hourshiftthe hourshift used to compare dates "more recent than"
Returns
a criterium object
Note
this function is recursive, it may throw Erange exception in case of syntaxical error
second point, the returned object is dynamically allocated, this is the duty of the caller to release its memory calling the delete operator.

§ dar_suite_global()

int dar_suite_global ( int  argc,
char *const  argv[],
const char **  env,
const char *  getopt_string,
char  stop_scan,
int(*)(user_interaction &dialog, int, char *const [], const char **env)  call 
)

common routine for all dar command-line tools to initialize environment and convert uncaught exceptions to exit status code

Parameters
[in]argcis the number of argument on the command line
[in]argvis the list of arguments on the command line
[in]envis the environment variables table obtained from main()
[in]getopt_stringis the parsing string to pass to getopt
[in]stop_scanwhile looking early for -j and -Q option will ignore all that follows stop_scan option if met
[in]callis a callback function to run once user interaction is initialized and to catch from the exceptions
Returns
the application exist status to use

§ line_tools_look_for()

void line_tools_look_for ( const std::vector< char > &  arguments,
S_I  argc,
char *const  argv[],
const char *  getopt_string,
char  stop_scan,
std::vector< char > &  presence 
)

test the presence of a set of argument on the command line

Parameters
[in]argumentsis the list of options to look for
[in]argcis the number of argument on the command line
[in]argvis the list of arguments on the command line
[in]getopt_stringis the parsing string to pass to getopt
[in]stop_scanif this (char) option is met, stop scanning for wanted options
[out]presenceis a subset of arguments containing the option found on command-line

§ line_tools_look_for_jQ()

void line_tools_look_for_jQ ( S_I  argc,
char *const  argv[],
const char *  getopt_string,
char  stop_scan,
bool &  j_is_present,
bool &  Q_is_present 
)

test the presence of -Q and -j options on the command line

Parameters
[in]argcis the number of argument on the command line
[in]argvis the list of arguments on the command line
[in]getopt_stringis the parsing string to pass to getopt
[in]stop_scanif this (char) option is met, stop scanning for -j and -Q options
[out]j_is_presentis set to true if -j option or its equivalent long option has been found on command-line
[out]Q_is_presentis set to true if -Q option or its equivalent long option has been found on command-line