QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
QGCCommandLineParser Namespace Reference

Classes

struct  CommandLineParseResult
 Result of parsing command-line arguments. More...
 

Enumerations

enum class  AppMode { Gui , BootTest }
 Application execution mode. More...
 

Functions

CommandLineParseResult parseCommandLine ()
 Parse command-line arguments (requires existing QCoreApplication)
 
CommandLineParseResult parse (int argc, char *argv[])
 Parse command-line arguments with automatic QCoreApplication management.
 
std::optional< int > handleParseResult (const CommandLineParseResult &result)
 Handle early exit conditions (help, version, error)
 
AppMode determineAppMode (const CommandLineParseResult &args)
 Determine the application mode from parsed arguments.
 

Enumeration Type Documentation

◆ AppMode

enum class QGCCommandLineParser::AppMode
strong

Application execution mode.

Enumerator
Gui 

Normal GUI application.

BootTest 

Initialize and exit (for CI validation)

Definition at line 81 of file QGCCommandLineParser.h.

Function Documentation

◆ determineAppMode()

AppMode QGCCommandLineParser::determineAppMode ( const CommandLineParseResult args)

Determine the application mode from parsed arguments.

Parameters
argsParsed command line arguments
Returns
The mode the application should run in

Referenced by main().

◆ handleParseResult()

std::optional< int > QGCCommandLineParser::handleParseResult ( const CommandLineParseResult result)

Handle early exit conditions (help, version, error)

Parameters
resultThe parse result to check
Returns
Exit code if main() should return immediately, std::nullopt to continue

Referenced by main().

◆ parse()

CommandLineParseResult QGCCommandLineParser::parse ( int  argc,
char *  argv[] 
)

Parse command-line arguments with automatic QCoreApplication management.

Parameters
argcArgument count from main()
argvArgument values from main()
Returns
Parsed result with status and option values
Note
Creates a temporary QCoreApplication internally for parsing

Referenced by main().

◆ parseCommandLine()

CommandLineParseResult QGCCommandLineParser::parseCommandLine ( )

Parse command-line arguments (requires existing QCoreApplication)

Returns
Parsed result with status and option values
Note
Prefer using parse() which manages the QCoreApplication lifecycle