summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMario Cianciolo <udda@users.noreply.github.com>2016-03-07 17:47:23 +0100
committerMario Cianciolo <udda@users.noreply.github.com>2016-03-07 17:47:23 +0100
commitd95d96f5ea42a493259e25dab99edd4bb2f569e0 (patch)
treedae6ba3fcc09098ba70e0a96ff4355c3242c5148 /src
parent904cc5007dde130ea45fa7f02c6a0c35dc9fa7e7 (diff)
downloadlibfaketime-d95d96f5ea42a493259e25dab99edd4bb2f569e0.tar.gz
Call printf only once in usage(char*)
Replace multiple calls to printf with one single call, passing the entire string at once. I think this is faster and more readable.
Diffstat (limited to 'src')
-rw-r--r--src/faketime.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/faketime.c b/src/faketime.c
index 3244dcb..2d3a96c 100644
--- a/src/faketime.c
+++ b/src/faketime.c
@@ -63,29 +63,29 @@ char sem_name[PATH_BUFSIZE] = {0}, shm_name[PATH_BUFSIZE] = {0};
void usage(const char *name)
{
- printf("\n");
- printf("Usage: %s [switches] <timestamp> <program with arguments>\n", name);
- printf("\n");
- printf("This will run the specified 'program' with the given 'arguments'.\n");
- printf("The program will be tricked into seeing the given 'timestamp' as its starting date and time.\n");
- printf("The clock will continue to run from this timestamp. Please see the manpage (man faketime)\n");
- printf("for advanced options, such as stopping the wall clock and make it run faster or slower.\n");
- printf("\n");
- printf("The optional switches are:\n");
- printf(" -m : Use the multi-threaded version of libfaketime\n");
- printf(" -f : Use the advanced timestamp specification format (see manpage)\n");
- printf(" --exclude-monotonic : Prevent monotonic clock from drifting (not the raw monotonic one)\n");
- printf("\n");
- printf("Examples:\n");
- printf("%s 'last friday 5 pm' /bin/date\n", name);
- printf("%s '2008-12-24 08:15:42' /bin/date\n", name);
- printf("%s -f '+2,5y x10,0' /bin/bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done'\n", name);
- printf("%s -f '+2,5y x0,50' /bin/bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done'\n", name);
- printf("%s -f '+2,5y i2,0' /bin/bash -c 'date; while true; do date; sleep 1 ; done'\n", name);
- printf("In this single case all spawned processes will use the same global clock\n");
- printf("without restaring it at the start of each process.\n\n");
- printf("(Please note that it depends on your locale settings whether . or , has to be used for fractions)\n");
- printf("\n");
+ printf("\n"
+ "Usage: %s [switches] <timestamp> <program with arguments>\n"
+ "\n"
+ "This will run the specified 'program' with the given 'arguments'.\n"
+ "The program will be tricked into seeing the given 'timestamp' as its starting date and time.\n"
+ "The clock will continue to run from this timestamp. Please see the manpage (man faketime)\n"
+ "for advanced options, such as stopping the wall clock and make it run faster or slower.\n"
+ "\n"
+ "The optional switches are:\n"
+ " -m : Use the multi-threaded version of libfaketime\n"
+ " -f : Use the advanced timestamp specification format (see manpage)\n"
+ " --exclude-monotonic : Prevent monotonic clock from drifting (not the raw monotonic one)\n"
+ "\n"
+ "Examples:\n"
+ "%s 'last friday 5 pm' /bin/date\n"
+ "%s '2008-12-24 08:15:42' /bin/date\n"
+ "%s -f '+2,5y x10,0' /bin/bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done'\n"
+ "%s -f '+2,5y x0,50' /bin/bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done'\n"
+ "%s -f '+2,5y i2,0' /bin/bash -c 'date; while true; do date; sleep 1 ; done'\n"
+ "In this single case all spawned processes will use the same global clock\n"
+ "without restaring it at the start of each process.\n\n"
+ "(Please note that it depends on your locale settings whether . or , has to be used for fractions)\n"
+ "\n", name, name, name, name, name, name);
}
/** Clean up shared objects */