aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-02-08 15:36:06 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-03-28 20:50:41 +0200
commitd7928e2e79e8ffc0e2c2ef0521b6ddda5fee860c (patch)
tree79f5f9b778007657015094c4af560efa9cfe4a07
parentf4a31779e42cf93a58c316756670c78a3ea8322b (diff)
downloadhardware_replicant_libsamsung-ipc-d7928e2e79e8ffc0e2c2ef0521b6ddda5fee860c.tar.gz
hardware_replicant_libsamsung-ipc-d7928e2e79e8ffc0e2c2ef0521b6ddda5fee860c.tar.bz2
hardware_replicant_libsamsung-ipc-d7928e2e79e8ffc0e2c2ef0521b6ddda5fee860c.zip
tools: ipc-modem: group contiguous printf calls
There is no use in making multiple calls to printf when only one call is sufficient. It's also a good practice to do that in general, especially when part of the code can print to the console at any time, to ensure that that all the buffer is printed contiguously and not interleaved with other prints. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r--tools/ipc-modem.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/tools/ipc-modem.c b/tools/ipc-modem.c
index ae410e6..31fd54e 100644
--- a/tools/ipc-modem.c
+++ b/tools/ipc-modem.c
@@ -476,19 +476,19 @@ int modem_stop(struct ipc_client *client)
void print_help(void)
{
- printf("usage: ipc-modem <command>\n");
- printf("commands:\n");
- printf("\tboot boot modem only\n");
- printf("\tpower-on power on the modem only\n");
- printf("\tpower-off power off the modem only\n");
- printf("\tstart boot modem and start read loop\n");
- printf("arguments:\n");
- printf("\t--call=[NUMBER] call NUMBER\n");
- printf("\t--debug enable debug messages\n");
- printf("\t--dry-run "
- "Test the ipc-modem program without talking to the modem.\n");
- printf("\t--help print this help message\n");
- printf("\t--pin=[PIN] provide SIM card PIN\n");
+ printf("usage: ipc-modem <command>\n"
+ "commands:\n"
+ "\tboot boot modem only\n"
+ "\tpower-on power on the modem only\n"
+ "\tpower-off power off the modem only\n"
+ "\tstart boot modem and start read loop\n"
+ "arguments:\n"
+ "\t--call=[NUMBER] call NUMBER\n"
+ "\t--debug enable debug messages\n"
+ "\t--dry-run "
+ "Test the ipc-modem program without talking to the modem.\n"
+ "\t--help print this help message\n"
+ "\t--pin=[PIN] provide SIM card PIN\n");
}
int handle_command(struct cmdline_opts *cmdline_opts)
@@ -673,10 +673,10 @@ int main(int argc, char *argv[])
}
if (cmdline_opts.command == CMD_NONE) {
- printf("\n");
- printf("Error: No command given. You need to use a command.\n");
- printf(" See the help below for more details.\n");
- printf("\n");
+ printf("\n"
+ "Error: No command given. You need to use a command.\n"
+ " See the help below for more details.\n"
+ "\n");
print_help();
return 1;
}