Skip to content

Commit 6130162

Browse files
committed
Add support for floating point options
1 parent abe9057 commit 6130162

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/include/server/mir/server.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ enum class OptionType
7878
integer,
7979
string,
8080
boolean,
81-
strings
81+
strings,
82+
real
8283
};
8384

8485
/// Customise and run a Mir server.

src/server/server.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -741,5 +741,19 @@ void mir::Server::add_configuration_option(
741741
self->set_add_configuration_options(option_adder);
742742
}
743743
break;
744+
745+
case OptionType::real:
746+
{
747+
auto const option_adder = [=](options::DefaultConfiguration& config)
748+
{
749+
existing(config);
750+
751+
config.add_options()
752+
(option.c_str(), po::value<double>(), description.c_str());
753+
};
754+
755+
self->set_add_configuration_options(option_adder);
756+
}
757+
break;
744758
}
745759
}

0 commit comments

Comments
 (0)