Compare commits
No commits in common. "ebfda949ea81ca7590c9cf65fdfeac59bce74636" and "40d98cdbb6bd5aa66897325ab04d3ede51b86ce0" have entirely different histories.
ebfda949ea
...
40d98cdbb6
@ -1,11 +1,3 @@
|
|||||||
// _____ _ _____
|
|
||||||
// |_ _|____ _| ||_ _|_ __
|
|
||||||
// | |/ _ \ \/ / __|| | \ \ / /
|
|
||||||
// | | __/> <| |_ | | \ V /
|
|
||||||
// |_|\___/_/\_\\__||_| \_/
|
|
||||||
// Author: Love Billenius <lovebillenius@disroot.org>
|
|
||||||
// License: GPL-3
|
|
||||||
|
|
||||||
#include "Command.h"
|
#include "Command.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -1,11 +1,3 @@
|
|||||||
// _____ _ _____
|
|
||||||
// |_ _|____ _| ||_ _|_ __
|
|
||||||
// | |/ _ \ \/ / __|| | \ \ / /
|
|
||||||
// | | __/> <| |_ | | \ V /
|
|
||||||
// |_|\___/_/\_\\__||_| \_/
|
|
||||||
// Author: Love Billenius <lovebillenius@disroot.org>
|
|
||||||
// License: GPL-3
|
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -50,9 +50,7 @@ void italize_numbers(std::string &content, size_t leave_chars = 0) {
|
|||||||
|
|
||||||
void pretty_format_page(std::string &content) {
|
void pretty_format_page(std::string &content) {
|
||||||
content.insert(0, ansi::BOLD);
|
content.insert(0, ansi::BOLD);
|
||||||
size_t line_end = content.find('\n');
|
const size_t line_end = content.find("\n");
|
||||||
if (line_end == std::string::npos)
|
|
||||||
line_end = content.size();
|
|
||||||
content.insert(line_end, ansi::CLEAR);
|
content.insert(line_end, ansi::CLEAR);
|
||||||
|
|
||||||
italize_numbers(content, line_end + ansi::CLEAR.size());
|
italize_numbers(content, line_end + ansi::CLEAR.size());
|
||||||
|
17
src/Tui.cpp
17
src/Tui.cpp
@ -1,11 +1,3 @@
|
|||||||
// _____ _ _____
|
|
||||||
// |_ _|____ _| ||_ _|_ __
|
|
||||||
// | |/ _ \ \/ / __|| | \ \ / /
|
|
||||||
// | | __/> <| |_ | | \ V /
|
|
||||||
// |_|\___/_/\_\\__||_| \_/
|
|
||||||
// Author: Love Billenius <lovebillenius@disroot.org>
|
|
||||||
// License: GPL-3
|
|
||||||
|
|
||||||
#include "Tui.h"
|
#include "Tui.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -54,14 +46,7 @@ void Tui::run() {
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
std::cout << "Enter a command: ";
|
std::cout << "Enter a command: ";
|
||||||
std::flush(std::cout);
|
std::flush(std::cout);
|
||||||
Command::Command command;
|
const Command::Command command = Command::readCommand();
|
||||||
try {
|
|
||||||
command = Command::readCommand();
|
|
||||||
} catch (const Command::NoNumberException &e) {
|
|
||||||
std::cout << e.what() << std::endl;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool should_exit = false;
|
bool should_exit = false;
|
||||||
auto visitor = [this, &should_exit]<typename T0>(T0 &&arg) {
|
auto visitor = [this, &should_exit]<typename T0>(T0 &&arg) {
|
||||||
|
@ -1,11 +1,3 @@
|
|||||||
// _____ _ _____
|
|
||||||
// |_ _|____ _| ||_ _|_ __
|
|
||||||
// | |/ _ \ \/ / __|| | \ \ / /
|
|
||||||
// | | __/> <| |_ | | \ V /
|
|
||||||
// |_|\___/_/\_\\__||_| \_/
|
|
||||||
// Author: Love Billenius <lovebillenius@disroot.org>
|
|
||||||
// License: GPL-3
|
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Page.hpp"
|
#include "Page.hpp"
|
||||||
|
|
||||||
|
18
src/ansi.hpp
18
src/ansi.hpp
@ -1,17 +1,11 @@
|
|||||||
// _____ _ _____
|
|
||||||
// |_ _|____ _| ||_ _|_ __
|
|
||||||
// | |/ _ \ \/ / __|| | \ \ / /
|
|
||||||
// | | __/> <| |_ | | \ V /
|
|
||||||
// |_|\___/_/\_\\__||_| \_/
|
|
||||||
// Author: Love Billenius <lovebillenius@disroot.org>
|
|
||||||
// License: GPL-3
|
|
||||||
|
|
||||||
#pragma once
|
namespace ansi
|
||||||
|
{
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace ansi {
|
constexpr std::string_view BOLD = "\033[1m";
|
||||||
constexpr std::string_view BOLD = "\033[1m";
|
constexpr std::string_view ITALIC = "\033[3m";
|
||||||
constexpr std::string_view ITALIC = "\033[3m";
|
constexpr std::string_view CLEAR = "\033[0m";
|
||||||
constexpr std::string_view CLEAR = "\033[0m";
|
|
||||||
} // namespace ansi
|
} // namespace ansi
|
||||||
|
@ -1,11 +1,3 @@
|
|||||||
// _____ _ _____
|
|
||||||
// |_ _|____ _| ||_ _|_ __
|
|
||||||
// | |/ _ \ \/ / __|| | \ \ / /
|
|
||||||
// | | __/> <| |_ | | \ V /
|
|
||||||
// |_|\___/_/\_\\__||_| \_/
|
|
||||||
// Author: Love Billenius <lovebillenius@disroot.org>
|
|
||||||
// License: GPL-3
|
|
||||||
|
|
||||||
#include "Page.hpp"
|
#include "Page.hpp"
|
||||||
#include "Tui.h"
|
#include "Tui.h"
|
||||||
|
|
||||||
|
@ -1,11 +1,3 @@
|
|||||||
// _____ _ _____
|
|
||||||
// |_ _|____ _| ||_ _|_ __
|
|
||||||
// | |/ _ \ \/ / __|| | \ \ / /
|
|
||||||
// | | __/> <| |_ | | \ V /
|
|
||||||
// |_|\___/_/\_\\__||_| \_/
|
|
||||||
// Author: Love Billenius <lovebillenius@disroot.org>
|
|
||||||
// License: GPL-3
|
|
||||||
|
|
||||||
#include "stringutil.hpp"
|
#include "stringutil.hpp"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -1,11 +1,3 @@
|
|||||||
// _____ _ _____
|
|
||||||
// |_ _|____ _| ||_ _|_ __
|
|
||||||
// | |/ _ \ \/ / __|| | \ \ / /
|
|
||||||
// | | __/> <| |_ | | \ V /
|
|
||||||
// |_|\___/_/\_\\__||_| \_/
|
|
||||||
// Author: Love Billenius <lovebillenius@disroot.org>
|
|
||||||
// License: GPL-3
|
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user