Update documentation of argument parser
This commit is contained in:
parent
3c769fa242
commit
8f4ca38c69
|
@ -469,7 +469,7 @@ inline bool notEmpty(const char *str)
|
||||||
* Instances of the Argument class are used as definition when parsing command line
|
* Instances of the Argument class are used as definition when parsing command line
|
||||||
* arguments. Arguments can be assigned to an ArgumentParser using
|
* arguments. Arguments can be assigned to an ArgumentParser using
|
||||||
* ArgumentParser::setMainArguments() and to another Argument instance using
|
* ArgumentParser::setMainArguments() and to another Argument instance using
|
||||||
* Argument::setSecondaryArguments().
|
* Argument::setSubArguments().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -629,7 +629,7 @@ Argument *firstPresentUncombinableArg(const ArgumentVector &args, const Argument
|
||||||
*
|
*
|
||||||
* \sa secondaryArguments()
|
* \sa secondaryArguments()
|
||||||
* \sa addSecondaryArgument()
|
* \sa addSecondaryArgument()
|
||||||
* \sa hasSecondaryArguments()
|
* \sa hasSubArguments()
|
||||||
*/
|
*/
|
||||||
void Argument::setSubArguments(const ArgumentInitializerList &secondaryArguments)
|
void Argument::setSubArguments(const ArgumentInitializerList &secondaryArguments)
|
||||||
{
|
{
|
||||||
|
@ -652,8 +652,8 @@ void Argument::setSubArguments(const ArgumentInitializerList &secondaryArguments
|
||||||
* \brief Adds \a arg as a secondary argument for this argument.
|
* \brief Adds \a arg as a secondary argument for this argument.
|
||||||
*
|
*
|
||||||
* \sa secondaryArguments()
|
* \sa secondaryArguments()
|
||||||
* \sa setSecondaryArguments()
|
* \sa setSubArguments()
|
||||||
* \sa hasSecondaryArguments()
|
* \sa hasSubArguments()
|
||||||
*/
|
*/
|
||||||
void Argument::addSubArgument(Argument *arg)
|
void Argument::addSubArgument(Argument *arg)
|
||||||
{
|
{
|
||||||
|
|
|
@ -267,13 +267,16 @@ class CPP_UTILITIES_EXPORT Argument {
|
||||||
public:
|
public:
|
||||||
typedef std::function<void(const ArgumentOccurrence &)> CallbackFunction;
|
typedef std::function<void(const ArgumentOccurrence &)> CallbackFunction;
|
||||||
|
|
||||||
|
/// \brief The Flags enum specifies options for treating the argument in a special way.
|
||||||
enum class Flags : std::uint64_t {
|
enum class Flags : std::uint64_t {
|
||||||
None = 0x0,
|
None = 0x0, /**< No flags are present. The default for Argument(). */
|
||||||
Combinable = 0x1,
|
Combinable
|
||||||
Implicit = 0x2,
|
= 0x1, /**< It is no error if this argument occurs besides other arguments on the same level. The default for ConfigValueArgument. */
|
||||||
Operation = 0x4,
|
Implicit = 0x2, /**< The argument is assumed to be present if its values are present. Only one argument can be implicit at the same level. */
|
||||||
Deprecated = 0x8,
|
Operation = 0x4, /**< The argument is an operation, so no `--` prefix is required when specifying it. The default for OperationArgument(). */
|
||||||
Greedy = 0x10,
|
Deprecated = 0x8, /**< The argument is considered deprecated and therefore excluded from the help. */
|
||||||
|
Greedy
|
||||||
|
= 0x10, /**< The argument is "greedy" so when Argument::varValueCount is used all subsequent arguments will be considered values of that argument. This is useful to pass remaining arguments down to another argument parser as-is. */
|
||||||
};
|
};
|
||||||
|
|
||||||
Argument(const char *name, char abbreviation = '\0', const char *description = nullptr, const char *example = nullptr);
|
Argument(const char *name, char abbreviation = '\0', const char *description = nullptr, const char *example = nullptr);
|
||||||
|
@ -952,8 +955,8 @@ inline void Argument::setCallback(Argument::CallbackFunction callback)
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns the secondary arguments for this argument.
|
* \brief Returns the secondary arguments for this argument.
|
||||||
*
|
*
|
||||||
* \sa setSecondaryArguments()
|
* \sa setSubArguments()
|
||||||
* \sa hasSecondaryArguments()
|
* \sa hasSubArguments()
|
||||||
*/
|
*/
|
||||||
inline const ArgumentVector &Argument::subArguments() const
|
inline const ArgumentVector &Argument::subArguments() const
|
||||||
{
|
{
|
||||||
|
@ -964,7 +967,7 @@ inline const ArgumentVector &Argument::subArguments() const
|
||||||
* \brief Returns an indication whether the argument has secondary arguments.
|
* \brief Returns an indication whether the argument has secondary arguments.
|
||||||
*
|
*
|
||||||
* \sa secondaryArguments()
|
* \sa secondaryArguments()
|
||||||
* \sa setSecondaryArguments()
|
* \sa setSubArguments()
|
||||||
*/
|
*/
|
||||||
inline bool Argument::hasSubArguments() const
|
inline bool Argument::hasSubArguments() const
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue