ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
clicamp.cpp
1// #################################################################################################
2// ALib C++ Library
3//
4// Copyright 2013-2024 A-Worx GmbH, Germany
5// Published under 'Boost Software License' (a free software license, see LICENSE.txt)
6// #################################################################################################
8
9#if !DOXYGEN
11
15#endif // !DOXYGEN
16
17
19
20namespace alib {
21
23
24//==================================================================================================
25/// This is the reference documentation of sub-namespace \c cli of the \aliblink, which
26/// holds types of library module \alib_cli_nl.
27///
28/// Besides this reference documentation, further documentation and source code samples for this
29/// module is provided with \ref alib_mod_cli "ALib Module CLI - Programmer's Manual".
30//==================================================================================================
31namespace cli {
32
34: Camp( "CLI" )
35{
36 ALIB_ASSERT_ERROR( this == &CLI, "CLI",
37 "Instances of class Cli must not be created. Use singleton alib::CLI" )
38}
39
40#define EOS ,
42{
44 {
47
48
49#if !ALIB_RESOURCES_OMIT_DEFAULTS
51
52 //--------- Exceptions ------
53 "E<" , A_CHAR( "cli::" ),
54
55 // general exceptions
56 "E0", A_CHAR( "1,NoCommandGiven" ",ED1" ),
57 "E1", A_CHAR( "2,UnknownCommand" ",ED2" ),
58
59 // option parsing exceptions
60 "E2", A_CHAR( "10,ParsingOptions" ",ED10" ),
61 "E3", A_CHAR( "11,MissingOptionValue" ",ED11" ),
62 "E4", A_CHAR( "12,IllegalOptionNameContinuation" ",ED12" ),
63
64 // command parsing exceptions
65 "E5", A_CHAR( "20,ParsingCommand" ",ED20" ),
66 "E6", A_CHAR( "21,MissingParameterValue" ",ED21" ) EOS
67
68 // messages of general exceptions
69 "ED1", A_CHAR( "No command given." ),
70 "ED2", A_CHAR( "Unknown command found with CLI argument{!Q[]}={!Q}" ),
71 "ED10", A_CHAR( "Error parsing option. Usage:\n"
72 "{}" ),
73 "ED20", A_CHAR( "Error parsing command.\n"
74 "Usage: {}\n"
75 "{}" ),
76
77
78 // messages of internal exceptions
79 "ED11", A_CHAR( "Missing argument(s) of option {!Q<>} found with CLI argument{!Q[]}={!Q}.\n"
80 "Expected {}, given {}." ),
81
82 "ED12", A_CHAR( "Option identifier {!Q<>} found at start of CLI argument{!Q[]}={!Q},\n"
83 "while CLI argument string continues with non-argument identifier characters." ),
84
85 "ED21", A_CHAR( "Missing argument(s) of parameter {!Q<>} found with CLI argument{!Q[]}={!Q}.\n"
86 "Quantity expected {}, quantity given {}." ) EOS
87
88
89 //--------- DryRunModes ------
90 "DRM<", A_CHAR( "DryRunModes::" ),
91DOX_MARKER([DOX_CLI_DRYRUN_RESOURCES])
92"DRM" , A_CHAR( "0" "," "Off" "," "1" ","
93 "2" "," "CLIDeclarations" "," "4" ","
94 "1" "," "CLIArgs" "," "1" ","
95 "3" "," "Application" "," "1" ),
96DOX_MARKER([DOX_CLI_DRYRUN_RESOURCES])
97 // end of BootstrapBulk()
98 nullptr );
99#endif // !ALIB_RESOURCES_OMIT_DEFAULTS
100
101 // parse enum records
104 }
105
106 else if( phase == BootstrapPhases::PrepareConfig )
107 {}
108 else if( phase == BootstrapPhases::Final )
109 {}
110
111}
112
113
114}} // namespace alib::cli
115
virtual void bootstrap(BootstrapPhases phase) override
Definition clicamp.cpp:41
NCString ResourceCategory
Definition camp.hpp:119
lang::resources::ResourcePool * resourcePool
Definition camp.hpp:75
virtual void BootstrapBulk(const nchar *category,...)=0
#define ALIB_BOXING_VTABLE_DEFINE(TMapped, Identifier)
Definition vtable.inl:473
#define A_CHAR(STR)
#define ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE(TAppendable)
#define ALIB_BOXING_BOOTSTRAP_VTABLE_DBG_REGISTER(Identifier)
Definition vtable.inl:489
#define ALIB_ASSERT_ERROR(cond,...)
Definition alib.hpp:1271
Definition alib.cpp:69
BootstrapPhases
Initialization levels usable with Bootstrapping ALib Camps.
Definition alib.hpp:1393
@ Final
The final initialization phase. Here, camps are initializing their custom setup.
cli::CliCamp CLI
The singleton instance of ALib Camp class CliCamp.
Definition clicamp.cpp:22
static void Bootstrap(TEnum element, TArgs &&... args) noexcept