cam: options: Move enum OptionArgument
The enumeration of the different possibilities for arguments can be used by other parser then OptionsParser. Move it outside the class to make it ready to be used by other parsers. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
65ea2422d2
commit
0b2822749e
2 changed files with 7 additions and 8 deletions
|
@ -38,8 +38,7 @@ static int parseOptions(int argc, char *argv[])
|
||||||
OptionsParser parser;
|
OptionsParser parser;
|
||||||
|
|
||||||
parser.addOption(OptCamera, "Specify which camera to operate on",
|
parser.addOption(OptCamera, "Specify which camera to operate on",
|
||||||
"camera", OptionsParser::ArgumentRequired,
|
"camera", ArgumentRequired, "camera");
|
||||||
"camera");
|
|
||||||
parser.addOption(OptHelp, "Display this help message", "help");
|
parser.addOption(OptHelp, "Display this help message", "help");
|
||||||
parser.addOption(OptList, "List all cameras", "list");
|
parser.addOption(OptList, "List all cameras", "list");
|
||||||
|
|
||||||
|
|
|
@ -11,15 +11,15 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
class OptionsParser
|
enum OptionArgument {
|
||||||
{
|
|
||||||
public:
|
|
||||||
enum OptionArgument {
|
|
||||||
ArgumentNone,
|
ArgumentNone,
|
||||||
ArgumentRequired,
|
ArgumentRequired,
|
||||||
ArgumentOptional,
|
ArgumentOptional,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class OptionsParser
|
||||||
|
{
|
||||||
|
public:
|
||||||
class Options {
|
class Options {
|
||||||
public:
|
public:
|
||||||
Options();
|
Options();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue