diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-11-19 00:31:03 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-11-19 00:31:03 -0800 |
commit | 26678682ca90b68f19b993e259bf43384c0a18ec (patch) | |
tree | af119f1845d12657d42e8ba57f90350c9f89c57f /builtin_jobs.cpp | |
parent | 7d63900fb8167d344a58c0c7e541166974b0c672 (diff) |
Fix indentation of switch statements
Diffstat (limited to 'builtin_jobs.cpp')
-rw-r--r-- | builtin_jobs.cpp | 168 |
1 files changed, 84 insertions, 84 deletions
diff --git a/builtin_jobs.cpp b/builtin_jobs.cpp index ab2da51b..dfd49f29 100644 --- a/builtin_jobs.cpp +++ b/builtin_jobs.cpp @@ -76,79 +76,79 @@ static void builtin_jobs_print(const job_t *j, int mode, int header) process_t *p; switch (mode) { - case JOBS_DEFAULT: - { - - if (header) + case JOBS_DEFAULT: { - /* - Print table header before first job - */ - stdout_buffer.append(_(L"Job\tGroup\t")); + + if (header) + { + /* + Print table header before first job + */ + stdout_buffer.append(_(L"Job\tGroup\t")); #ifdef HAVE__PROC_SELF_STAT - stdout_buffer.append(_(L"CPU\t")); + stdout_buffer.append(_(L"CPU\t")); #endif - stdout_buffer.append(_(L"State\tCommand\n")); - } + stdout_buffer.append(_(L"State\tCommand\n")); + } - append_format(stdout_buffer, L"%d\t%d\t", j->job_id, j->pgid); + append_format(stdout_buffer, L"%d\t%d\t", j->job_id, j->pgid); #ifdef HAVE__PROC_SELF_STAT - append_format(stdout_buffer, L"%d%%\t", cpu_use(j)); + append_format(stdout_buffer, L"%d%%\t", cpu_use(j)); #endif - stdout_buffer.append(job_is_stopped(j)?_(L"stopped"):_(L"running")); - stdout_buffer.append(L"\t"); - stdout_buffer.append(j->command_wcstr()); - stdout_buffer.append(L"\n"); - break; - } - - case JOBS_PRINT_GROUP: - { - if (header) - { - /* - Print table header before first job - */ - stdout_buffer.append(_(L"Group\n")); + stdout_buffer.append(job_is_stopped(j)?_(L"stopped"):_(L"running")); + stdout_buffer.append(L"\t"); + stdout_buffer.append(j->command_wcstr()); + stdout_buffer.append(L"\n"); + break; } - append_format(stdout_buffer, L"%d\n", j->pgid); - break; - } - case JOBS_PRINT_PID: - { - if (header) + case JOBS_PRINT_GROUP: { - /* - Print table header before first job - */ - stdout_buffer.append(_(L"Procces\n")); + if (header) + { + /* + Print table header before first job + */ + stdout_buffer.append(_(L"Group\n")); + } + append_format(stdout_buffer, L"%d\n", j->pgid); + break; } - for (p=j->first_process; p; p=p->next) + case JOBS_PRINT_PID: { - append_format(stdout_buffer, L"%d\n", p->pid); - } - break; - } + if (header) + { + /* + Print table header before first job + */ + stdout_buffer.append(_(L"Procces\n")); + } - case JOBS_PRINT_COMMAND: - { - if (header) - { - /* - Print table header before first job - */ - stdout_buffer.append(_(L"Command\n")); + for (p=j->first_process; p; p=p->next) + { + append_format(stdout_buffer, L"%d\n", p->pid); + } + break; } - for (p=j->first_process; p; p=p->next) + case JOBS_PRINT_COMMAND: { - append_format(stdout_buffer, L"%ls\n", p->argv0()); + if (header) + { + /* + Print table header before first job + */ + stdout_buffer.append(_(L"Command\n")); + } + + for (p=j->first_process; p; p=p->next) + { + append_format(stdout_buffer, L"%ls\n", p->argv0()); + } + break; } - break; - } } } @@ -212,45 +212,45 @@ static int builtin_jobs(parser_t &parser, wchar_t **argv) switch (opt) { - case 0: - if (long_options[opt_index].flag != 0) - break; - append_format(stderr_buffer, - BUILTIN_ERR_UNKNOWN, - argv[0], - long_options[opt_index].name); + case 0: + if (long_options[opt_index].flag != 0) + break; + append_format(stderr_buffer, + BUILTIN_ERR_UNKNOWN, + argv[0], + long_options[opt_index].name); - builtin_print_help(parser, argv[0], stderr_buffer); + builtin_print_help(parser, argv[0], stderr_buffer); - return 1; + return 1; - case 'p': - mode=JOBS_PRINT_PID; - break; + case 'p': + mode=JOBS_PRINT_PID; + break; - case 'c': - mode=JOBS_PRINT_COMMAND; - break; + case 'c': + mode=JOBS_PRINT_COMMAND; + break; - case 'g': - mode=JOBS_PRINT_GROUP; - break; + case 'g': + mode=JOBS_PRINT_GROUP; + break; - case 'l': - { - print_last = 1; - break; - } + case 'l': + { + print_last = 1; + break; + } - case 'h': - builtin_print_help(parser, argv[0], stdout_buffer); - return 0; + case 'h': + builtin_print_help(parser, argv[0], stdout_buffer); + return 0; - case '?': - builtin_unknown_option(parser, argv[0], argv[woptind-1]); - return 1; + case '?': + builtin_unknown_option(parser, argv[0], argv[woptind-1]); + return 1; } } |