Skip to content

Commit

Permalink
reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
bcumming committed Sep 27, 2024
1 parent 6e03d9c commit 746f717
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/cli/color.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <unistd.h>
#include <stdio.h>
#include <unistd.h>

#include <fmt/format.h>

Expand Down
8 changes: 4 additions & 4 deletions src/cli/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

#include <fmt/color.h>

#define MAKE_COLOR(color) \
static auto color() { \
return fmt::emphasis::bold | fg(fmt::terminal_color::color); \
#define MAKE_COLOR(color) \
static auto color() { \
return fmt::emphasis::bold | fg(fmt::terminal_color::color); \
} \
template <typename S> constexpr auto color(const S& s) { \
return use_color()? fmt::format(color(), "{}", s): std::string(s); \
return use_color() ? fmt::format(color(), "{}", s) : std::string(s); \
}

namespace color {
Expand Down
2 changes: 1 addition & 1 deletion src/cli/run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ int run(const run_args& args, const global_settings& globals) {
std::string run_footer() {
using enum help::block::admonition;
using help::block;
using help::lst;
using help::linebreak;
using help::lst;
std::vector<help::item> items{
// clang-format off
block{none, "Run a command in an environment."},
Expand Down
14 changes: 7 additions & 7 deletions src/cli/uenv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ int main(int argc, char** argv) {

CLI::App cli(fmt::format("uenv {}", UENV_VERSION));
cli.add_flag("-v,--verbose", settings.verbose, "enable verbose output");
cli.add_flag_callback("--no-color",
[]() -> void {color::set_color(false);},
"disable color output");
cli.add_flag_callback("--color",
[]() -> void {color::set_color(true);},
"enable color output");
cli.add_flag_callback(
"--no-color", []() -> void { color::set_color(false); },
"disable color output");
cli.add_flag_callback(
"--color", []() -> void { color::set_color(true); },
"enable color output");
cli.add_flag("--repo", settings.repo_, "the uenv repository");
cli.add_flag("--version", print_version, "print version");

Expand All @@ -51,7 +51,7 @@ int main(int argc, char** argv) {

CLI11_PARSE(cli, argc, argv);

//color::set_color(!settings.no_color);
// color::set_color(!settings.no_color);

// Warnings and errors are always logged. The verbosity level is increased
// with repeated uses of --verbose.
Expand Down

0 comments on commit 746f717

Please sign in to comment.