diff options
author | 2012-11-19 00:31:03 -0800 | |
---|---|---|
committer | 2012-11-19 00:31:03 -0800 | |
commit | 26678682ca90b68f19b993e259bf43384c0a18ec (patch) | |
tree | af119f1845d12657d42e8ba57f90350c9f89c57f /complete.cpp | |
parent | 7d63900fb8167d344a58c0c7e541166974b0c672 (diff) |
Fix indentation of switch statements
Diffstat (limited to 'complete.cpp')
-rw-r--r-- | complete.cpp | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/complete.cpp b/complete.cpp index 77018810..ce094485 100644 --- a/complete.cpp +++ b/complete.cpp @@ -702,20 +702,20 @@ int complete_is_valid_option(const wcstring &str, switch (opt.size()) { - case 0: - case 1: - { - return true; - } - - case 2: - { - if (opt == L"--") + case 0: + case 1: { return true; } - break; - } + + case 2: + { + if (opt == L"--") + { + return true; + } + break; + } } if (opt.at(0) != L'-') @@ -1816,73 +1816,73 @@ void complete(const wcstring &cmd, std::vector<completion_t> &comps, complete_ty switch (tok_last_type(&tok)) { - case TOK_STRING: - { - - const wcstring ncmd = tok_last(&tok); - int is_ddash = (ncmd == L"--") && ((tok_get_pos(&tok)+2) < (long)pos); - - if (!had_cmd) + case TOK_STRING: { - if (parser_keywords_is_subcommand(ncmd)) + const wcstring ncmd = tok_last(&tok); + int is_ddash = (ncmd == L"--") && ((tok_get_pos(&tok)+2) < (long)pos); + + if (!had_cmd) { - if (ncmd == L"builtin") - { - use_function = 0; - use_command = 0; - use_builtin = 1; - } - else if (ncmd == L"command") + + if (parser_keywords_is_subcommand(ncmd)) { - use_command = 1; - use_function = 0; - use_builtin = 0; + if (ncmd == L"builtin") + { + use_function = 0; + use_command = 0; + use_builtin = 1; + } + else if (ncmd == L"command") + { + use_command = 1; + use_function = 0; + use_builtin = 0; + } + break; } - break; - } - if (!is_ddash || - ((use_command && use_function && use_builtin))) - { - current_command = ncmd; + if (!is_ddash || + ((use_command && use_function && use_builtin))) + { + current_command = ncmd; - size_t token_end = tok_get_pos(&tok) + ncmd.size(); + size_t token_end = tok_get_pos(&tok) + ncmd.size(); - on_command = (pos <= token_end); - had_cmd=1; - } + on_command = (pos <= token_end); + had_cmd=1; + } - } - else - { - if (is_ddash) + } + else { - had_ddash = 1; + if (is_ddash) + { + had_ddash = 1; + } } - } - break; - } + break; + } - case TOK_END: - case TOK_PIPE: - case TOK_BACKGROUND: - { - had_cmd=0; - had_ddash = 0; - use_command = 1; - use_function = 1; - use_builtin = 1; - break; - } + case TOK_END: + case TOK_PIPE: + case TOK_BACKGROUND: + { + had_cmd=0; + had_ddash = 0; + use_command = 1; + use_function = 1; + use_builtin = 1; + break; + } - case TOK_ERROR: - { - end_loop=1; - break; - } + case TOK_ERROR: + { + end_loop=1; + break; + } } |