Rename Options to RenderParams

This commit is contained in:
josh committed 2026-11-01 13:20:59 -05:00
1 parent 7eaf5f9555
commit 1947ea553c
6 files changed
+14 -14

No files matched your search

+5 -5
View File
@@ -128,12 +128,12 @@ int Cli::run(int argc, char * argv[])
} }
else else
{ {
if (this->options.input_file != "") if (this->params.input_file != "")
{ {
fprintf(stderr, "Extraneous argument: %s\n", argv[i]); fprintf(stderr, "Extraneous argument: %s\n", argv[i]);
return 2; return 2;
} }
this->options.input_file = argv[i]; this->params.input_file = argv[i];
} }
} }
return 0; return 0;
@@ -170,7 +170,7 @@ int Cli::handle_option(size_t flag_idx, const char * arg_value)
{ {
case flag_height: case flag_height:
case flag_height_l: case flag_height_l:
if (!parse_size(flag_defs[flag_idx].flag, arg_value, &this->options.height)) if (!parse_size(flag_defs[flag_idx].flag, arg_value, &this->params.height))
{ {
return 2; return 2;
} }
@@ -190,12 +190,12 @@ int Cli::handle_option(size_t flag_idx, const char * arg_value)
case flag_output: case flag_output:
case flag_output_l: case flag_output_l:
this->options.output_file = arg_value; this->params.output_file = arg_value;
return 0; return 0;
case flag_width: case flag_width:
case flag_width_l: case flag_width_l:
if (!parse_size(flag_defs[flag_idx].flag, arg_value, &this->options.width)) if (!parse_size(flag_defs[flag_idx].flag, arg_value, &this->params.width))
{ {
return 2; return 2;
} }
+2 -2
View File
@@ -1,11 +1,11 @@
#pragma once #pragma once
#include <fart/Options.h> #include <fart/RenderParams.h>
class Cli class Cli
{ {
public: public:
Options options; RenderParams params;
int run(int argc, char * argv[]); int run(int argc, char * argv[]);
+2 -2
View File
@@ -1,7 +1,7 @@
#include <fart/Engine.h> #include <fart/Engine.h>
Engine::Engine(const Options & options) Engine::Engine(const RenderParams & params)
: options(options) : params(params)
{ {
} }
+3 -3
View File
@@ -1,13 +1,13 @@
#pragma once #pragma once
#include <fart/Options.h> #include <fart/RenderParams.h>
class Engine class Engine
{ {
public: public:
Engine(const Options & options); Engine(const RenderParams & params);
int run(); int run();
protected: protected:
Options options; RenderParams params;
}; };
@@ -3,7 +3,7 @@
#include <stddef.h> #include <stddef.h>
#include <string> #include <string>
struct Options struct RenderParams
{ {
std::string input_file; std::string input_file;
std::string output_file; std::string output_file;
+1 -1
View File
@@ -10,6 +10,6 @@ int main(int argc, char * argv[])
{ {
return rc - 1; return rc - 1;
} }
Engine engine(cli.options); Engine engine(cli.params);
return engine.run(); return engine.run();
} }