Adapt to new versioning
This commit is contained in:
parent
9dc0315dd1
commit
b745001633
28
src/main.cpp
28
src/main.cpp
@ -19,6 +19,9 @@
|
||||
#include <libscnumerics.hpp>
|
||||
#include <sc/plugin.hpp>
|
||||
|
||||
// project
|
||||
#include "version.hpp"
|
||||
|
||||
const int WIDTH {1600};
|
||||
const int HEIGHT {900};
|
||||
|
||||
@ -37,10 +40,6 @@ void print_help() {
|
||||
std::cout << " --version show version number and exit\n";
|
||||
}
|
||||
|
||||
void print_version() {
|
||||
std::cout << "screensaver version 1.0\n";
|
||||
}
|
||||
|
||||
void list_plugins() {
|
||||
for (const std::string& name : sc::plugin<ScreensaverPlugin>::names()) {
|
||||
std::cout << name << '\n';
|
||||
@ -106,25 +105,16 @@ int main(int argc, char* argv[]) {
|
||||
// handle long-only options here
|
||||
switch (opt_val) {
|
||||
case 1:
|
||||
print_version();
|
||||
std::cout << screensaver_version() << '\n';
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'h':
|
||||
print_help();
|
||||
return EXIT_SUCCESS;
|
||||
case 'l':
|
||||
list_plugins();
|
||||
return EXIT_SUCCESS;
|
||||
case 'r':
|
||||
random_saver = true;
|
||||
break;
|
||||
case 'w':
|
||||
small_window = true;
|
||||
break;
|
||||
case '?':
|
||||
throw std::runtime_error("unrecognized option");
|
||||
case 'h': print_help(); return EXIT_SUCCESS;
|
||||
case 'l': list_plugins(); return EXIT_SUCCESS;
|
||||
case 'r': random_saver = true; break;
|
||||
case 'w': small_window = true; break;
|
||||
case '?': throw std::runtime_error("unrecognized option");
|
||||
}
|
||||
}
|
||||
std::vector<std::string> names {sc::plugin<ScreensaverPlugin>::names()};
|
||||
|
Loading…
x
Reference in New Issue
Block a user