/* main.cpp: parses options, runs slop, prints results.
*
* Copyright (C) 2014: Dalton Nell, Slop Contributors (https://github.com/naelstrof/slop/graphs/contributors).
*
* This file is part of Slop.
*
* Slop is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Slop is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Slop. If not, see .
*/
#include
#include
#include "slop.hpp"
#include "options.hpp"
SlopOptions* getOptions( Options& options ) {
SlopOptions* foo = new SlopOptions();
options.getFloat("bordersize", 'b', foo->borderSize);
options.getFloat("padding", 'p', foo->padding);
options.getFloat("tolerance", 't', foo->tolerance);
glm::vec4 color = glm::vec4( foo->r, foo->g, foo->b, foo->a );
options.getColor("color", 'c', color);
options.getString( "xdisplay", 'x', foo->xdisplay );
foo->r = color.r;
foo->g = color.g;
foo->b = color.b;
foo->a = color.a;
options.getBool("highlight", 'h', foo->highlight);
options.getBool("nodecorations", 'n', foo->nodecorations);
return foo;
}
std::string formatOutput( std::string input, SlopSelection selection ) {
std::stringstream output;
for( unsigned int i=0;iwhat() << "\n";
return 1;
} // let the operating system handle any other kind of exception.
return 1;
}