Refactor: make function static and reformat

"IndentCaseLabels: false" seems nice but not now.
This commit is contained in:
Johannes Altmanninger 2020-09-22 00:16:00 +02:00
parent 383f1d1a19
commit ca538fa8d8

View file

@ -1666,7 +1666,7 @@ static void append_switch(wcstring &out, const wcstring &opt) {
append_format(out, L" --%ls", opt.c_str()); append_format(out, L" --%ls", opt.c_str());
} }
wcstring completion2string(const complete_entry_opt_t &o, wcstring cmd, bool is_path) { static wcstring completion2string(const complete_entry_opt_t &o, wcstring cmd, bool is_path) {
wcstring out; wcstring out;
out.append(L"complete"); out.append(L"complete");
@ -1685,18 +1685,18 @@ wcstring completion2string(const complete_entry_opt_t &o, wcstring cmd, bool is_
append_switch(out, is_path ? L'p' : L'c', cmd); append_switch(out, is_path ? L'p' : L'c', cmd);
switch (o.type) { switch (o.type) {
case option_type_args_only: { case option_type_args_only: {
break; break;
} }
case option_type_short: { case option_type_short: {
append_switch(out, L's', wcstring(1, o.option.at(0))); append_switch(out, L's', wcstring(1, o.option.at(0)));
break; break;
} }
case option_type_single_long: case option_type_single_long:
case option_type_double_long: { case option_type_double_long: {
append_switch(out, o.type == option_type_single_long ? L'o' : L'l', o.option); append_switch(out, o.type == option_type_single_long ? L'o' : L'l', o.option);
break; break;
} }
} }
append_switch(out, L'd', C_(o.desc)); append_switch(out, L'd', C_(o.desc));