From f055e5b6752b9dc5fe7b27ca0b41d1e03d2bd798 Mon Sep 17 00:00:00 2001 From: Stefan Haustein Date: Sat, 23 Mar 2019 22:33:10 +0100 Subject: [PATCH] Revert "Persistence options" This reverts commit aef2fbccdcc903d6e9735dcb3013dda08d8b842a. --- README.md | 6 ------ src/main/cpp/tiv.cpp | 10 +--------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/README.md b/README.md index f1f0ded..4b2926a 100644 --- a/README.md +++ b/README.md @@ -65,9 +65,3 @@ If multiple images match the filename spec, thumbnails are shown. The top image was generated with the character optimization disabled via the `-0` option. ![Comparison](https://i.imgur.com/OzdCeh6.png) - -## Save file - -Saving the disk image for use in other processes or softwares via the -o option - -![Persistence](https://i.imgur.com/LMb5KBX.png) diff --git a/src/main/cpp/tiv.cpp b/src/main/cpp/tiv.cpp index a5d6128..aeb1fc5 100644 --- a/src/main/cpp/tiv.cpp +++ b/src/main/cpp/tiv.cpp @@ -17,7 +17,6 @@ const int FLAG_BG = 2; const int FLAG_MODE_256 = 4; const int FLAG_24BIT = 8; const int FLAG_NOOPT = 16; -const int FLAG_SAVE = 32; const int COLOR_STEP_COUNT = 6; const int COLOR_STEPS[COLOR_STEP_COUNT] = {0, 0x5f, 0x87, 0xaf, 0xd7, 0xff}; @@ -419,7 +418,6 @@ void emit_usage() { std::cerr << " -help : Display this help text." << std::endl; std::cerr << " -h : Set the maximum height to lines." << std::endl; std::cerr << " -w : Set the maximum width to characters." << std::endl << std::endl; - std::cerr << " -o : Output file name." << std::endl << std::endl; } enum Mode {AUTO, THUMBNAILS, FULL_SIZE}; @@ -450,7 +448,6 @@ int main(int argc, char* argv[]) { int flags = 0; Mode mode = AUTO; int columns = 3; - std::string output_file; std::vector file_names; int error = 0; @@ -464,9 +461,6 @@ int main(int argc, char* argv[]) { std::string arg(argv[i]); if (arg == "-0") { flags |= FLAG_NOOPT; - } else if (arg == "-o") { - output_file = argv[++i]; - flags |= FLAG_SAVE; } else if (arg == "-c") { columns = std::stoi(argv[++i]); } else if (arg == "-d") { @@ -496,9 +490,7 @@ int main(int argc, char* argv[]) { } } - if ((flags & FLAG_SAVE) != 0) { - freopen(output_file.c_str(),"w",stdout); - } + if (mode == FULL_SIZE || (mode == AUTO && file_names.size() == 1)) { for (unsigned int i = 0; i < file_names.size(); i++) { try {