32 #if !ALIB_CHARACTERS_WIDE
35 for (
int i= 1; i <
ARG_C ; ++i )
47 for (
int i= 1; i <
ARG_C ; ++i )
55 #if ALIB_CHARACTERS_NATIVE_WCHAR
58 for (
int i= 1; i <
ARG_C ; ++i )
71 for (
int i= 1; i <
ARG_C ; ++i )
93 auto argNo=
ArgsLeft[size_t(argIdx)];
114 if( option->
Read( **optionDeclIt, arg, argNo ) )
122 (*optionDeclIt)->HelpUsageLine() );
159 for(
auto optionIt=
Options.rbegin() ; optionIt !=
Options.rend() ; optionIt ++ )
160 if( (*optionIt)->Declaration->Element() == element )
169 bool lastCommandFullyParsed=
true;
170 while( lastCommandFullyParsed &&
ArgsLeft.size() > 0 )
179 lastCommandFullyParsed= command->
Read( *commandDecl );
185 commandDecl->HelpTextShort() );
242 ALIB_ERROR(
"CLI",
"Argument number {} already removed.", argNo )
static ALIB_API AString GetCommandUsageFormat(CommandLine &cmdLine, CommandDecl &commandDecl)
List< MonoAllocator, CommandDecl * > CommandDecls
Commands defined.
lang::resources::ResourcePool * Resources
void Init(lang::Camp *resModule)
virtual ALIB_API Command * NextCommand()
virtual String GetArg(integer idx)
List< MonoAllocator, Command * > CommandsParsed
A list of commands actually parsed. Filled with method ReadNextCommands.
StdVectorMono< integer > ArgsLeft
NCString ResourceCategory
The resource category to fetch CLI resources within field Resources.
List< MonoAllocator, Option * > Options
The options parsed in the order of their appearance.
List< MonoAllocator, String, Recycling::Shared > OptionArgsIgnored
virtual ALIB_API void ReadOptions()
virtual ALIB_API String PopArg()
ALIB_API void RemoveArg(integer argNo)
List< MonoAllocator, Command * >::Iterator NextCommandIt
The next command in CommandsParsed to be processed. Used with method NextCommand.
ALIB_API Option * GetOption(Enum element)
StdVectorMono< String > ArgStrings
List< MonoAllocator, OptionDecl * > OptionDecls
Possible Options.
virtual ALIB_API void ReadNextCommands()
const String & ShortcutReplacementString()
Exception & Add(const lang::CallerInfo &ci, TEnum type, TArgs &&... args)
void DbgDisableBufferReplacementWarning()
constexpr bool IsNotEmpty() const
TChar CharAtStart() const
#define ALIB_CALLER_NULLED
#define ALIB_WARNINGS_RESTORE
#define ALIB_ASSERT_ERROR(cond,...)
#define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE
@ ParsingOptions
General option parse error. Adds option help text.
@ ParsingCommand
General parameter parse error. Adds command help text.
@ NoCommandGiven
Unknown command given.
@ UnknownCommand
Unknown command given.
lang::Exception Exception
Type alias in namespace alib.
strings::TString< character > String
Type alias in namespace alib.
constexpr String NULL_STRING
A nulled string of the default character type.
lang::integer integer
Type alias in namespace alib.
A command of a ALib CLI command line.
ALIB_API bool Read(CommandDecl &decl)
OptionDecl * Declaration
The declaration struct.
ALIB_API bool Read(OptionDecl &decl, String &arg, const integer argNo)
integer ConsumedArguments