NoTeX 1.0.0
A modern noteworthy LaTeX template
Loading...
Searching...
No Matches
output.hpp
Go to the documentation of this file.
1
11
12#pragma once
13
14#include <optional>
15#include <string_view>
16
17namespace notex::ui {
18
28void set_assume_yes(bool assume_yes);
29
31bool assume_yes();
32
34void success(std::string_view message);
35
38void warning(std::string_view message);
39
41void error(std::string_view message);
42
44void step(std::string_view message);
45
47void info(std::string_view message);
48
64bool confirm(std::string_view prompt, bool default_answer = false);
65
83 std::optional<bool> is_interactive);
84
85} // namespace notex::ui
void set_stdin_interactive_override_for_testing(std::optional< bool > is_interactive)
Testing seam: overrides whether confirm() treats standard input as an interactive terminal.
Definition output.cpp:45
bool assume_yes()
Definition output.cpp:43
void error(std::string_view message)
Prints an error message, prefixed with a red cross, to stderr.
Definition output.cpp:58
void info(std::string_view message)
Prints a plain informational message to stdout.
Definition output.cpp:66
void success(std::string_view message)
Prints a success message, prefixed with a green checkmark, to stdout.
Definition output.cpp:50
void warning(std::string_view message)
Definition output.cpp:54
void set_assume_yes(bool assume_yes)
Sets whether confirm() should answer "yes" without prompting.
Definition output.cpp:41
void step(std::string_view message)
Prints a step or progress message, prefixed with an arrow, to stdout.
Definition output.cpp:62
bool confirm(std::string_view prompt, bool default_answer=false)
Asks the user to confirm an action.
Definition output.cpp:68