settings: add startup_slave_screen option

This commit is contained in:
brezerk
2014-11-06 20:13:46 +01:00
committed by Andrzej Rybczak
parent a4e9523f63
commit cc747c0f99
10 changed files with 49 additions and 12 deletions

View File

@@ -56,6 +56,7 @@ bool configure(int argc, char **argv)
("config,c", po::value<std::string>(&config_path)->default_value("~/.ncmpcpp/config"), "specify configuration file")
("bindings,b", po::value<std::string>(&bindings_path)->default_value("~/.ncmpcpp/bindings"), "specify bindings file")
("screen,s", po::value<std::string>(), "specify initial screen")
("slave-screen,S", po::value<std::string>(), "specify initial slave screen")
("help,?", "show help message")
("version,v", "display version information")
;
@@ -176,6 +177,18 @@ bool configure(int argc, char **argv)
exit(1);
}
}
// custom startup slave screen
if (vm.count("slave-screen"))
{
auto screen = vm["slave-screen"].as<std::string>();
Config.startup_slave_screen_type = stringtoStartupScreenType(screen);
if (Config.startup_slave_screen_type == ScreenType::Unknown)
{
std::cerr << "Unknown slave screen: " << screen << "\n";
exit(1);
}
}
}
catch (std::exception &e)
{