ALib C++ Library
Library Version: 1912 R0
Documentation generated by doxygen
cliapp.hpp
Go to the documentation of this file.
1 /** ************************************************************************************************
2  * \file
3  * This header file is part of module \alib_cli of the \aliblong.
4  *
5  * \emoji :copyright: 2013-2019 A-Worx GmbH, Germany.
6  * Published under \ref mainpage_license "Boost Software License".
7  **************************************************************************************************/
8 #ifndef HPP_ALIB_CLI_CLIAPP
9 #define HPP_ALIB_CLI_CLIAPP 1
10 
11 #if !defined (HPP_ALIB_CLI_ARGUMENTS)
12  #include "alib/cli/arguments.hpp"
13 #endif
14 
15 #if !defined(HPP_ALIB_COMPATIBILITY_STD_BOXING_FUNCTIONAL)
17 #endif
18 
19 #if !defined (HPP_ALIB_MONOMEM_HASHMAP)
20 # include "alib/monomem/hashmap.hpp"
21 #endif
22 
23 #if !defined (HPP_ALIB_MONOMEM_STDCONTAINERMA)
25 #endif
26 
27 
28 namespace aworx { namespace lib { namespace cli {
29 
30 class CLIUtil;
31 
32 
33 /** ************************************************************************************************
34  * This class provides a foundation for software executables that processes command line
35  * parameters.
36  *
37  * For an introduction to its use see documentation of \ref aworx::lib::cli "ALib Module CLI".
38  *
39  * \see
40  * "Utility" methods which could have been implemented as an interface of this
41  * class have instead been located in \alib{cli,CLIUtil}.
42  *
43  * ## Friends ##
44  * class \alib{cli,CLIUtil}
45  *
46 \~Comment ####################################################################################### \~
47  * @throws aworx::lib::cli::Exceptions
48  **************************************************************************************************/
49 class CLIApp
50 {
51  // #############################################################################################
52  // Type definitions
53  // #############################################################################################
54  #if !defined(ALIB_DOX)
55  // This friend provides utility methods for using this class.
56  friend class CommandDecl;
57  friend struct Command;
58  friend struct Option;
59  friend struct Parameter;
60 
61  friend class CLIUtil;
62  #endif
63 
64  // #############################################################################################
65  // Type definitions
66  // #############################################################################################
67  public:
68 
69  // #############################################################################################
70  // protected fields
71  // #############################################################################################
72  protected:
73  /** Monotonic allocator used for all resourced static definitions as well as the data
74  * used during parsing. */
76 
77  /** The element recycler shared between lists of strings. */
79 
80  /** The element recycler shared between fields \alib{cli,Command::ParametersMandatory} and
81  * \alib{cli,Command::ParametersOptional}. */
83 
84  // #############################################################################################
85  // Fields
86  // #############################################################################################
87  public:
88  /**
89  * Application information text.
90  * Used as a sort of "header" output by class \alib{cli,CLIUtil} .
91  */
93 
94  // ################################## Arguments ############################################
95  /**
96  * The original number of command line arguments (provided in constructor)
97  */
99 
100  /**
101  * The original command line arguments (provided in constructor). Might be nullptr, if
102  * \c wchar_t variant of constructor was used.
103  */
104  const char** ArgNOriginal;
105 
106  /**
107  * The original command line arguments (provided in constructor) Might be nullptr, if
108  * \c char variant of constructor was used.
109  */
110  const wchar_t** ArgWOriginal;
111 
112  /**
113  * A vector of args. If the type of CLI argument strings provided with the constructor does
114  * not match the \ref ALIB_CHARACTERS_WIDE "default ALib string width", the strings get
115  * converted.<br>
116  * Values that are 'consumed' by options that get defined, are \b not removed from this
117  * list. Instead, they are removed from index vector #ArgsLeft.
118  */
119  std::vector<String, StdContMA<String>> ArgStrings;
120 
121  /**
122  * A vector of args. If constructor variant accepting \b wchar strings is used,
123  * those unicode strings get converted to 1-byte strings using the current locale.<br>
124  * Values that are 'consumed' by options that get defined, are removed.
125  */
126  std::vector<integer, StdContMA<integer>> ArgsLeft;
127 
128  // ############################ Declarations (from custom enums) ###########################
129  /** Commands defined. */
131 
132  /** Possible Options. */
134 
135  /** Possible Parameters. */
137 
138  /** Possible Errors. */
140 
141  // ################################ Parsed CLI objects ########################################
142 
143 
144  /** The options parsed in the order of their appearance. */
146 
147  /**
148  * List of arguments that start with a hyphen and are ignored by this class due to the
149  * fact that they were not recognized.
150  *
151  * \see Method #ReadOptions for details on this.
152  */
154 
155  /** A list of commands actually parsed. Filled with method #ReadNextCommands. */
157 
158  /** The next command in #CommandsParsed to be processed. Used with method #NextCommand. */
160 
161  /**
162  * The maximum length of token names:
163  * - 0: Commands
164  * - 1: Options
165  *
166  * Note: Used for formatted help/dump output. (0= command, 1= option, 2= param) */
167  integer MaxNameLength[3] = { 0,0, 0 };
168 
169  /**
170  * The module of the main application. Several resources are loaded from this in addition
171  * to what is loaded as enum meta information of the cli declaration objects.
172  */
173  Module* ResModule = nullptr;
174 
175  /**
176  * Specifies if a "dry run" should be performed.
177  * For more information, see \alib{cli,CLIUtil::GetDryOpt}.
178  */
180 
181  // #############################################################################################
182  // Constructor/destructor
183  // #############################################################################################
184  public:
185  /**
186  * Constructor.
187  */
189  : allocator ( 2048 )
190  , ArgStrings ( allocator )
191  , ArgsLeft ( allocator )
192  , CommandDecls ( &allocator )
193  , OptionDecls ( &allocator )
195  , ExitCodeDecls ( &allocator, 3.0, 10.0 )
196  , Options ( &allocator )
199  , NextCommandIt ( CommandsParsed.end() )
200  {}
201 
202  /**
203  * Virtual empty destructor.
204  */
205  virtual ~CLIApp()
206  {}
207 
208  // #############################################################################################
209  // Definition interface
210  // #############################################################################################
211  public:
212  /** ****************************************************************************************
213  * Initializes this class. This function has to be invoked after construction and
214  * after the \alib module system is initialized.
215  *
216  * @param resModule The module used to load resource strings.
217  ******************************************************************************************/
218  ALIB_API
219  virtual
220  void Init( Module* resModule );
221 
222  #if defined(ALIB_DOX)
223  /** ****************************************************************************************
224  * Defines parameters given with enumeration \p{TEnum}.
225  * \ref alib_enums_records "ALib Enum Records" of type \alib{cli,ERParameterDecl} need to
226  * associated to given enumeration type \p{TEnum}.
227  *
228  * @tparam TEnum The enum type.
229  ******************************************************************************************/
230  template<typename TEnum>
231  inline
232  void DefineParameters();
233  #else
234  template<typename TEnum>
235  ATMP_VOID_IF( EnumRecords<TEnum>::template AreOfType<ERParameterDecl>() )
237  {
238  for( auto recordIt= EnumRecords<TEnum>::begin()
239  ; recordIt!= EnumRecords<TEnum>::end ()
240  ; ++ recordIt )
241  {
242  ParameterDecls.EmplaceBack( allocator.Emplace<ParameterDecl>( recordIt.Enum() ) );
243 
244  if ( MaxNameLength[2] < recordIt->EnumElementName.Length() )
245  MaxNameLength[2]= recordIt->EnumElementName.Length();
246  }
247  }
248  #endif
249 
250 
251  #if defined(ALIB_DOX)
252  /** ****************************************************************************************
253  * Defines commands given with enumeration \p{TEnum}.
254  * \ref alib_enums_records "ALib Enum Records" of type \alib{cli,ERCommandDecl} need to
255  * associated to given enumeration type \p{TEnum}.
256  *
257  * @tparam TEnum The enum type.
258  ******************************************************************************************/
259  template<typename TEnum>
260  inline
261  void DefineCommands();
262  #else
263  template<typename TEnum>
264  ATMP_VOID_IF( EnumRecords<TEnum>::template AreOfType<ERCommandDecl>() )
266  {
267  for( auto recordIt= EnumRecords<TEnum>::begin()
268  ; recordIt!= EnumRecords<TEnum>::end ()
269  ; ++ recordIt )
270  {
271  CommandDecls.EmplaceBack( allocator.Emplace<CommandDecl>( recordIt.Enum(), *this ) );
272 
273  auto& name= CommandDecls.Back()->Identifier();
274  if ( MaxNameLength[0] < name.Length() )
275  MaxNameLength[0]= name.Length();
276  }
277  }
278  #endif
279 
280 
281  #if defined(ALIB_DOX)
282  /** ****************************************************************************************
283  * Defines options given with enumeration \p{TEnum}.
284  * \ref alib_enums_records "ALib Enum Records" of type \alib{cli,EROptionDecl} need to
285  * associated to given enumeration type \p{TEnum}.
286  *
287  * @tparam TEnum The enum type.
288  ******************************************************************************************/
289  template<typename TEnum>
290  inline
291  void DefineOptions();
292  #else
293  template<typename TEnum>
294  ATMP_VOID_IF( EnumRecords<TEnum>::template AreOfType<EROptionDecl>() )
295  DefineOptions()
296  {
297  for( auto recordIt= EnumRecords<TEnum>::begin()
298  ; recordIt!= EnumRecords<TEnum>::end ()
299  ; ++ recordIt )
300  {
301  OptionDecls.EmplaceBack( allocator.Emplace<OptionDecl>( recordIt.Enum() ) );
302 
303  if ( MaxNameLength[1] < recordIt->EnumElementName.Length() )
304  MaxNameLength[1]= recordIt->EnumElementName.Length();
305  }
306  }
307  #endif
308 
309 
310 
311 
312  #if defined(ALIB_DOX)
313  /** ****************************************************************************************
314  * Defines errors given with enumeration \p{TEnum}.
315  * \ref alib_enums_records "ALib Enum Records" of type \alib{cli,ERExitCodeDecl} need to
316  * associated to given enumeration type \p{TEnum}.
317  *
318  * @tparam TEnum The enum type.
319  ******************************************************************************************/
320  template<typename TEnum>
321  inline
322  void DefineExitCodes();
323  #else
324  template<typename TEnum>
325  ATMP_VOID_IF( EnumRecords<TEnum>::template AreOfType<ERExitCodeDecl>() )
327  {
328  for( auto recordIt= EnumRecords<TEnum>::begin()
329  ; recordIt!= EnumRecords<TEnum>::end ()
330  ; ++ recordIt )
331  ExitCodeDecls.EmplaceUnique( recordIt.Enum(),
332  allocator.Emplace<ExitCodeDecl>(recordIt.Enum()) );
333  }
334  #endif
335 
336 
337  // #############################################################################################
338  // Parsing interface
339  // #############################################################################################
340  public:
341  /** ****************************************************************************************
342  * Finalizes Initialization and has to be called after all invocations of:
343  * - DefineCommands,
344  * - DefineOptions,
345  * - DefineParameters and
346  * - DefineExitCodes,
347  *
348  * have been performed. All options recognized get collected in list #Options
349  * The arguments of the options get removed from #ArgsLeft.
350  *
351  * In case of options that have own parameter arguments, such arguments may not be fully
352  * removed. This depends on whether it is possible with the simple flags and values
353  * provided in \alib{cli,OptionDecl} to enable class \alib{cli,Option} to fully detect
354  * them. Therefore, after this method is invoked, for options with more complex syntax,
355  * custom code may be needed to pull the "remainders" of option arguments from #ArgsLeft.
356  * For this, field \alib{cli,Option::Position} is quite useful, as well as method
357  * #RemoveArg.
358  *
359  * It has to be assured that before the next step, which is the invocation of
360  * #ReadNextCommands, all option-related CLI arguments are cleaned away!
361  *
362  * For this reason, this method removes all arguments that start with a
363  * hyphen \c '-' from the #ArgsLeft, even if they got \e not recognized. Those CLI arguments
364  * get collected in #OptionArgsIgnored.
365  * Finding unrecognized options is not considered an error, because other libraries used
366  * with the software might read CLI options autonomously.
367  *
368  * \note
369  * A good sample for this is class \alib{config,CLIArgs} used with \alib
370  * configuration variables. After this method has been invoked, vector #OptionArgsIgnored
371  * may/should be passed to the plug-in \b %CLIArgs of (all)
372  * \alib{config,Configuration} object(s) used with the application. For this, an
373  * invocation, similar to this may be used with all \alibmods that use an own configuration
374  * object:
375  *
376  * XYZModule.GetConfig().GetPluginTypeSafe<aworx::lib::config::CLIArgs>()->SetArgs( &OptionArgsIgnored );
377  *
378  * In the case that other libraries have more complex option syntax, e.g. options
379  * consisting of multiple arguments or such that do not even start with a hyphen character,
380  * then, this method should be called <b>only after a custom code removes such 3rd party
381  * options in a reliable way!</b>
382  *
383  * If all this was not done, the "remainder" of custom options might confuse parsing
384  * of commands and its parameters and most probably would lead to an
385  * "unknown" command error when the remainders of non-removed 3rd party option arguments
386  * are consumed later.
387  *
388  * As a consequence of this approach, a subsequent call to this method has no effect.
389  ******************************************************************************************/
390  ALIB_API
391  virtual
392  void ReadOptions();
393 
394  /** ****************************************************************************************
395  * Searches and returns the last occurrence of the specified option.
396  *
397  * This method is to be used with options that overwrite previous values in case
398  * that it was given multiple times as a the CLI argument.
399  *
400  * @param element The option's declaration enum element.
401  * @return A pointer to the parsed option, respectively \c nullptr if not given.
402  ******************************************************************************************/
403  Option* GetOption( Enum element );
404 
405  /** ****************************************************************************************
406  * Parses as many commands as possible and stores them in #CommandsParsed. Prior
407  * to invoking this methods, all CLI declarations have to be made. Furthermore, usually
408  * method #ReadOptions has to be invoked prior to this method.
409  *
410  * The name of the method indicates that one or more, but maybe not all commands are read.
411  * The reason for this behavior lies in the fact that commands may be defined that
412  * do their own, specifically coded parsing. As a matter of the fact that the flags and
413  * options of structs \alib{cli,CommandDecl} and \alib{cli,ParameterDecl} are kept rather
414  * simple to match the most usual cases, the parsing of arguments of a command often
415  * has to be left to be done by custom code. Mostly just when processing (executing) a
416  * command. In contrast to the need of parsing (and processing) all CLI options,
417  * given prior to processing commands, this is not a problem. The usual inner part of a
418  * command processing loop then looks like this:
419  * - Check if #CommandsParsed is empty
420  * - Invoke this method (\b %ReadNextCommands )
421  * - If still no command is found, break loop
422  * - Remove and process first command in #CommandsParsed.
423  *
424  * A similar parsing approach is supported with method #NextCommand. The only difference
425  * is that the parsed commands stay in #CommandsParsed and instead field #NextCommandIt
426  * indicates the position of the next command to read. This way, commands may refer
427  * to previous ones, if this is needed.
428  *
429  * As a final note it should be mentioned, that implementing a "dry run" option on the
430  * level of command parsing, for the reasons explained above, might need some specific
431  * custom code to be able to parse all commands (without processing them). If such
432  * functionality is wanted, it is best to separate custom command parsing from
433  * command execution (the opposite was recommended above). Only the last command in the list
434  * has to be 'manually' processed, as the previous ones obviously got parsed well.
435  * With this approach, all commands can be parsed without executing them. Static utility
436  * method \alib{cli,CLIUtil::DumpParseResults} is a predefined way to then write information
437  * about all options and commands parsed.<br>
438  * A lower level "dry run", that receives information about the concrete actions that the
439  * processing of commands would perform, is of-course a different, application specific
440  * task.
441  ******************************************************************************************/
442  ALIB_API
443  virtual
444  void ReadNextCommands();
445 
446  /** ****************************************************************************************
447  * Returns the next item in vector #NextCommand. If needed, #ReadNextCommands is
448  * invoked.
449  * @return The next command parsed from CLI argument list. \c nullptr, if no more commands
450  * are found.
451  ******************************************************************************************/
452  ALIB_API
453  virtual
454  Command* NextCommand();
455 
456  /** ****************************************************************************************
457  * Retrieves the argument at the given position.
458  *
459  * In debug builds, this method assert the index range.
460  *
461  * @return The element \p{idx} of vector #ArgStrings.
462  ******************************************************************************************/
463  virtual
465  {
466  return static_cast<integer>(ArgStrings.size());
467  }
468 
469  /** ****************************************************************************************
470  * Retrieves the argument at the given position.<br>
471  * In debug builds, this method assert the index range.
472  * @param idx The requested argument's index.
473  * @return The element \p{idx} of vector #ArgStrings.
474  ******************************************************************************************/
475  virtual
477  {
478  ALIB_ASSERT_ERROR( idx >= 0 && static_cast<size_t>(idx) < ArgStrings.size(),
479  "Index out of bounds" )
480  return ArgStrings[static_cast<size_t>(idx)];
481  }
482 
483  /** ****************************************************************************************
484  * Retrieves the next argument from the list without removing it.
485  *
486  * \see Method #PopArg, #RemoveArg and #ReadNextCommands.
487  *
488  * @return The first argument of (respectively remaining in) the list.
489  * If no argument is available, a \e nulled string is returned.
490  ******************************************************************************************/
491  virtual
493  {
494  return ArgsLeft.size() > 0 ? ArgStrings[static_cast<size_t>(ArgsLeft[0])]
495  : String();
496  }
497 
498  /** ****************************************************************************************
499  * Retrieves the next argument and removes it from list #ArgsLeft.
500  *
501  * \see Method #PeekArg, #RemoveArg and #ReadNextCommands.
502  *
503  * @return The first argument of vector #ArgsLeft.
504  * If no argument is available, a \e nulled string is returned.
505  ******************************************************************************************/
506  ALIB_API
507  virtual
508  String PopArg();
509 
510  /** ****************************************************************************************
511  * Removes the argument at position \p{argNo}.
512  * If the argument is not in #ArgsLeft, an \alib assertion is raised.
513  *
514  * \see Method #PeekArg, #PopArg and #ReadNextCommands.
515  *
516  * @param argNo The argument number to remove.
517  ******************************************************************************************/
518  ALIB_API
519  void RemoveArg( integer argNo );
520 }; // class CLIApp
521 
522 
523 
524 // #############################################################################################
525 // Definitions of methods of related objects that can be only mede after CLIApp is defined
526 // #############################################################################################
527 inline
529 : Parsed( parent )
530 , Args ( &Parent->allocator, parent->stringListRecycler )
531 {}
532 
534 : Parsed( parent )
535 , Args ( &Parent->allocator, parent->stringListRecycler )
536 {}
537 
538 template<typename TEnum>
539 CommandDecl::CommandDecl( TEnum element, CLIApp& parent )
540 : declElement ( element )
541 , resourceInfo(element)
542 , Parent (parent)
543 , Parameters (&Parent.allocator)
544 {
545  // make a copy of the resourced record
546  record= enums::GetRecord(element);
547 
548  addParamDecls();
549 }
550 
552 : Parsed ( parent )
553 , ParametersMandatory( &Parent->allocator, parent->paramListRecycler )
554 , ParametersOptional ( &Parent->allocator, parent->paramListRecycler )
555 {}
556 
557 
558 }} // namespace lib::system
559 
560 /// Type alias in namespace #aworx.
562 
563 
564 } // namespace [aworx]
565 
566 
567 
568 #endif // HPP_ALIB_CLI_CLIAPP
aworx::lib::monomem::MonoAllocator::Emplace
ALIB_FORCE_INLINE T * Emplace(TArgs &&... args)
Definition: monoallocator.hpp:485
aworx::lib::cli::Command
Definition: arguments.hpp:660
aworx::lib::cli::CLIApp::~CLIApp
virtual ~CLIApp()
Definition: cliapp.hpp:205
aworx::lib::cli::CommandDecl::addParamDecls
ALIB_API void addParamDecls()
Definition: arguments.cpp:38
aworx::lib::cli::CLIApp::GetOption
Option * GetOption(Enum element)
Definition: cliapp.cpp:166
aworx::lib::cli::CLIApp::DefineCommands
void DefineCommands()
aworx::lib::cli::CLIApp::ArgCount
virtual integer ArgCount()
Definition: cliapp.hpp:464
ATMP_VOID_IF
#define ATMP_VOID_IF(Cond)
Definition: tmp.hpp:49
hashmap.hpp
aworx::CLIUtil
lib::cli::CLIUtil CLIUtil
Type alias in namespace aworx.
Definition: cliutil.hpp:239
aworx::lib::integer
platform_specific integer
Definition: integers.hpp:53
aworx::lib::monomem::List
Definition: list.hpp:65
aworx::lib::cli::CLIApp::ArgStrings
std::vector< String, StdContMA< String > > ArgStrings
Definition: cliapp.hpp:119
aworx::lib::cli::CLIApp
Definition: cliapp.hpp:49
aworx::lib::cli::CLIUtil
Definition: cliutil.hpp:40
aworx::lib::cli::CLIApp::PeekArg
virtual String PeekArg()
Definition: cliapp.hpp:492
aworx::lib::cli::CLIApp::DefineExitCodes
void DefineExitCodes()
aworx::lib::cli::CLIApp::stringListRecycler
List< String, Recycling::Shared >::TSharedRecycler stringListRecycler
Definition: cliapp.hpp:78
aworx::lib::monomem::HashTable
Definition: hashtable.hpp:453
aworx::String
lib::strings::TString< character > String
Type alias in namespace aworx.
Definition: strings/fwds.hpp:81
aworx::lib::cli::Option::Option
Option(CLIApp *parent)
Definition: cliapp.hpp:533
aworx::lib::cli::CLIApp::AppInfo
String AppInfo
Definition: cliapp.hpp:92
aworx::lib::cli::CLIApp::Init
virtual ALIB_API void Init(Module *resModule)
Definition: cliapp.cpp:30
aworx::lib::cli::ParameterDecl
Definition: arguments.hpp:113
aworx::lib::enums::EnumRecords::begin
static ForwardIterator begin()
Definition: records.hpp:439
aworx::lib::cli::CommandDecl
Definition: arguments.hpp:557
aworx::lib::cli::CLIApp::Arg
virtual String Arg(integer idx)
Definition: cliapp.hpp:476
aworx::lib::strings::TString
Definition: strings/fwds.hpp:42
aworx::lib::cli::CLIApp::CLIApp
CLIApp()
Definition: cliapp.hpp:188
aworx::lib::cli::CLIApp::RemoveArg
ALIB_API void RemoveArg(integer argNo)
Definition: cliapp.cpp:243
aworx::lib::cli::Parameter::Parameter
Parameter(CLIApp *parent)
Definition: cliapp.hpp:528
aworx::lib::cli::CLIApp::ResModule
Module * ResModule
Definition: cliapp.hpp:173
aworx::lib::cli::CLIApp::DefineOptions
void DefineOptions()
aworx::lib::cli::CLIApp::paramListRecycler
List< Parameter *, Recycling::Shared >::TSharedRecycler paramListRecycler
Definition: cliapp.hpp:82
aworx::lib::cli::Command::Command
Command(CLIApp *parent)
Definition: cliapp.hpp:551
aworx::lib::ForwardList
Definition: forwardlist.hpp:22
arguments.hpp
aworx::lib::enums::EnumRecords::end
static constexpr ForwardIterator end()
Definition: records.hpp:450
aworx::lib::cli::CLIApp::OptionArgsIgnored
List< String, Recycling::Shared > OptionArgsIgnored
Definition: cliapp.hpp:153
aworx::lib::cli::CLIApp::ArgWOriginal
const wchar_t ** ArgWOriginal
Definition: cliapp.hpp:110
aworx::lib::cli::CLIApp::DryRun
DryRunModes DryRun
Definition: cliapp.hpp:179
aworx::lib::cli::CLIApp::ArgsLeft
std::vector< integer, StdContMA< integer > > ArgsLeft
Definition: cliapp.hpp:126
aworx::lib::cli::CLIApp::ReadNextCommands
virtual ALIB_API void ReadNextCommands()
Definition: cliapp.cpp:175
aworx
Definition: alox/alox.hpp:40
aworx::Enum
lib::boxing::Enum Enum
Type alias in namespace aworx.
Definition: enum.hpp:346
aworx::lib::cli::Parameter
Definition: arguments.hpp:256
aworx::lib::cli::CLIApp::CommandsParsed
List< Command > CommandsParsed
Definition: cliapp.hpp:156
aworx::lib::cli::CLIApp::NextCommandIt
List< Command >::Iterator NextCommandIt
Definition: cliapp.hpp:159
aworx::lib::cli::CLIApp::Options
List< Option * > Options
Definition: cliapp.hpp:145
aworx::lib::cli::CLIApp::ExitCodeDecls
HashMap< Enum, ExitCodeDecl * > ExitCodeDecls
Definition: cliapp.hpp:139
ALIB_ASSERT_ERROR
#define ALIB_ASSERT_ERROR(cond,...)
Definition: assert.hpp:119
aworx::lib::enums::GetRecord
const T_EnumRecords< TEnum >::Type & GetRecord(TEnum element)
ALIB_API
#define ALIB_API
Definition: compilers.hpp:128
aworx::CLIApp
lib::cli::CLIApp CLIApp
Type alias in namespace aworx.
Definition: cliapp.hpp:561
aworx::lib::cli::CLIApp::CommandDecls
List< CommandDecl * > CommandDecls
Definition: cliapp.hpp:130
aworx::lib::cli::CLIApp::OptionDecls
List< OptionDecl * > OptionDecls
Definition: cliapp.hpp:133
aworx::lib::cli::CLIApp::MaxNameLength
integer MaxNameLength[3]
Definition: cliapp.hpp:167
aworx::lib::cli::CLIApp::NextCommand
virtual ALIB_API Command * NextCommand()
Definition: cliapp.cpp:209
aworx::lib::cli::Parsed
Definition: arguments.hpp:39
aworx::lib::cli::CLIApp::ParameterDecls
List< ParameterDecl * > ParameterDecls
Definition: cliapp.hpp:136
aworx::lib::cli::CLIApp::DefineParameters
void DefineParameters()
stdcontainerma.hpp
aworx::lib::monomem::List::TIterator
Definition: list.hpp:122
aworx::lib::cli::CLIApp::allocator
MonoAllocator allocator
Definition: cliapp.hpp:75
aworx::lib::cli::CLIApp::PopArg
virtual ALIB_API String PopArg()
Definition: cliapp.cpp:233
aworx::lib::cli::DryRunModes
DryRunModes
Definition: cli.hpp:102
aworx::lib::cli::CommandDecl::CommandDecl
CommandDecl(TEnum element, CLIApp &parent)
Definition: cliapp.hpp:539
aworx::lib::cli::Option
Definition: arguments.hpp:496
aworx::lib::cli::CLIApp::ReadOptions
virtual ALIB_API void ReadOptions()
Definition: cliapp.cpp:95
aworx::lib::Module
Definition: module.hpp:71
aworx::lib::cli::CommandDecl::record
ERCommandDecl record
Definition: arguments.hpp:564
aworx::lib::cli::DryRunModes::Off
No dry run.
aworx::lib::cli::CLIApp::ArgcOriginal
int ArgcOriginal
Definition: cliapp.hpp:98
std_boxing_functional.hpp
aworx::lib::cli::CLIApp::ArgNOriginal
const char ** ArgNOriginal
Definition: cliapp.hpp:104
aworx::lib::monomem::MonoAllocator
Definition: monoallocator.hpp:77
aworx::lib::enums::EnumRecords
Definition: records.hpp:280