Skip to content

Commit

Permalink
- coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
aschnell committed Oct 2, 2024
1 parent 78ddfa3 commit 4c6e6d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
13 changes: 6 additions & 7 deletions client/snapper/cmd-list-configs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ namespace snapper


void
output_table(const vector<Column>& columns, Style style, ProxySnappers* snappers)
output_table(const GlobalOptions& global_options, const vector<Column>& columns, ProxySnappers* snappers)
{
TableFormatter formatter(style);
TableFormatter formatter(global_options.table_style());

for (Column column : columns)
formatter.header().push_back(header_for(column));
Expand All @@ -120,10 +120,9 @@ namespace snapper


void
output_csv(const GlobalOptions& global_options, const vector<Column>& columns, const string& separator,
ProxySnappers* snappers)
output_csv(const GlobalOptions& global_options, const vector<Column>& columns, ProxySnappers* snappers)
{
CsvFormatter formatter(separator, global_options.headers());
CsvFormatter formatter(global_options.separator(), global_options.headers());

for (Column column : columns)
formatter.header().push_back(toString(column));
Expand Down Expand Up @@ -195,11 +194,11 @@ namespace snapper
switch (global_options.output_format())
{
case GlobalOptions::OutputFormat::TABLE:
output_table(columns, global_options.table_style(), snappers);
output_table(global_options, columns, snappers);
break;

case GlobalOptions::OutputFormat::CSV:
output_csv(global_options, columns, global_options.separator(), snappers);
output_csv(global_options, columns, snappers);
break;

case GlobalOptions::OutputFormat::JSON:
Expand Down
3 changes: 1 addition & 2 deletions client/snapper/snapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ struct Cmd
typedef void (*help_func_t)();

Cmd(const string& name, cmd_func_t cmd_func, help_func_t help_func, bool needs_snapper)
: name(name), aliases(), cmd_func(cmd_func), help_func(help_func),
needs_snapper(needs_snapper)
: name(name), cmd_func(cmd_func), help_func(help_func), needs_snapper(needs_snapper)
{}

Cmd(const string& name, const vector<string>& aliases, cmd_func_t cmd_func,
Expand Down

0 comments on commit 4c6e6d3

Please sign in to comment.