Changeset 079f92a31281573b8a7b152b1730e7a349ac6365
- Timestamp:
- 11/01/09 12:06:00 (2 years ago)
- Author:
- Erwan Velu <erwan.velu@…>
- Children:
- c2f4ec7d2a22c57853b6616d4ab49d79c6744d25
- Parents:
- dff89818c3b64eff6f31f04dcef240c5a9daff4c
- git-author:
- Pierre-Alexandre Meyer <pierre@mouraf.org> / 2009-11-01T00:12:16Z-0700
- git-committer:
- Erwan Velu <erwan.velu@free.fr> / 2009-11-01T13:06:00Z+0100
- Message:
-
hdt: use plain printf for help, not more_printf (CLI)
The help prints several elements on the same line. This can't
work with more_printf() as the macro assumes each call contains
one and only one \n.
Signed-off-by: Pierre-Alexandre Meyer <pierre@…>
- Location:
- com32/hdt
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
rdff898
|
r079f92
|
|
| 54 | 54 | |
| 55 | 55 | reset_more_printf(); |
| 56 | | more_printf("Available modes:\n"); |
| | 56 | printf("Available modes:\n"); |
| 57 | 57 | while (list_modes[i]) { |
| 58 | | more_printf("%s ", list_modes[i]->name); |
| | 58 | printf("%s ", list_modes[i]->name); |
| 59 | 59 | i++; |
| 60 | 60 | } |
| 61 | | more_printf("\n"); |
| | 61 | printf("\n"); |
| 62 | 62 | } |
| 63 | 63 | |
| … |
… |
|
| 120 | 120 | find_cli_mode_descr(hdt_cli.mode, ¤t_mode); |
| 121 | 121 | |
| 122 | | reset_more_printf(); |
| 123 | | more_printf("Available commands are:\n"); |
| | 122 | printf("Available commands are:\n"); |
| 124 | 123 | |
| 125 | 124 | /* List first default modules of the mode */ |
| … |
… |
|
| 127 | 126 | current_mode->default_modules->modules) { |
| 128 | 127 | while (current_mode->default_modules->modules[j].name) { |
| 129 | | more_printf("%s ", |
| | 128 | printf("%s ", |
| 130 | 129 | current_mode->default_modules->modules[j].name); |
| 131 | 130 | j++; |
| 132 | 131 | } |
| 133 | | more_printf("\n"); |
| | 132 | printf("\n"); |
| 134 | 133 | } |
| 135 | 134 | |
| … |
… |
|
| 137 | 136 | if (current_mode->show_modules && |
| 138 | 137 | current_mode->show_modules->modules) { |
| 139 | | more_printf("\nshow commands:\n"); |
| | 138 | printf("\nshow commands:\n"); |
| 140 | 139 | j = 0; |
| 141 | 140 | while (current_mode->show_modules->modules[j].name) { |
| 142 | | more_printf("%s ", |
| | 141 | printf("%s ", |
| 143 | 142 | current_mode->show_modules->modules[j].name); |
| 144 | 143 | j++; |
| 145 | 144 | } |
| 146 | | more_printf("\n"); |
| | 145 | printf("\n"); |
| 147 | 146 | } |
| 148 | 147 | |
| … |
… |
|
| 150 | 149 | if (current_mode->set_modules && |
| 151 | 150 | current_mode->set_modules->modules) { |
| 152 | | more_printf("\nset commands:\n"); |
| | 151 | printf("\nset commands:\n"); |
| 153 | 152 | j = 0; |
| 154 | 153 | while (current_mode->set_modules->modules[j].name) { |
| 155 | | more_printf("%s ", |
| | 154 | printf("%s ", |
| 156 | 155 | current_mode->set_modules->modules[j].name); |
| 157 | 156 | j++; |
| 158 | 157 | } |
| 159 | | more_printf("\n"); |
| | 158 | printf("\n"); |
| 160 | 159 | } |
| 161 | 160 | |
| … |
… |
|
| 177 | 176 | &associated_module); |
| 178 | 177 | if (associated_module == NULL) |
| 179 | | more_printf("%s ", |
| | 178 | printf("%s ", |
| 180 | 179 | hdt_mode.default_modules->modules[j].name); |
| 181 | 180 | j++; |
| 182 | 181 | } |
| 183 | | more_printf("\n"); |
| 184 | | } |
| 185 | | |
| 186 | | more_printf("\n"); |
| | 182 | printf("\n"); |
| | 183 | } |
| | 184 | |
| | 185 | printf("\n"); |
| 187 | 186 | main_show_modes(argc, argv, hardware); |
| 188 | 187 | } |
-
|
rdff898
|
r079f92
|
|
| 66 | 66 | } while (0); |
| 67 | 67 | |
| | 68 | /* The brokeness of that macro is that |
| | 69 | * it assumes that __VA_ARGS__ contains |
| | 70 | * one \n (and only one) |
| | 71 | */ |
| 68 | 72 | #define more_printf(...) do {\ |
| 69 | 73 | if (display_line_nb == 20) {\ |
| … |
… |
|
| 74 | 78 | }\ |
| 75 | 79 | printf(__VA_ARGS__);\ |
| 76 | | display_line_nb++; \ |
| | 80 | display_line_nb++;\ |
| 77 | 81 | } while (0); |
| 78 | 82 | |