summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorJoel Stanley <joel@jms.id.au>2018-08-14 13:38:06 +0930
committerAlistair Popple <alistair@popple.id.au>2018-09-07 13:42:16 +1000
commit7be30ef70a4964b6dc199a207b57d62799987a3f (patch)
tree836368c47b8897d9c4b5be5e159bc192d2c5bcaa /src/main.c
parentb65867d84267a0f85d127507d1be512361ef04ae (diff)
downloadpdbg-7be30ef70a4964b6dc199a207b57d62799987a3f.tar.gz
pdbg-7be30ef70a4964b6dc199a207b57d62799987a3f.zip
progress: No more progress
This adds an option to suppress progress: -S, --shutup Shut up those annoying progress bars Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index b48c201..099b2e5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -37,6 +37,7 @@
#include "htm.h"
#include "options.h"
#include "optcmd.h"
+#include "progress.h"
#define PR_ERROR(x, args...) \
pdbg_log(PDBG_ERROR, x, ##args)
@@ -161,6 +162,8 @@ static void print_usage(char *pname)
printf("\t\tand defaults to 0x50 for I2C\n");
printf("\t-D, --debug=<debug level>\n");
printf("\t\t0:error (default) 1:warning 2:notice 3:info 4:debug\n");
+ printf("\t-S, --shutup\n");
+ printf("\t\tShut up those annoying progress bars\n");
printf("\t-V, --version\n");
printf("\t-h, --help\n");
printf("\n");
@@ -327,6 +330,7 @@ static bool parse_options(int argc, char *argv[])
{"cpu", required_argument, NULL, 'l'},
#endif
{"debug", required_argument, NULL, 'D'},
+ {"shutup", no_argument, NULL, 'S'},
{"version", no_argument, NULL, 'V'},
{NULL, 0, NULL, 0}
};
@@ -338,7 +342,7 @@ static bool parse_options(int argc, char *argv[])
memset(l_list, 0, sizeof(l_list));
do {
- c = getopt_long(argc, argv, "+ab:c:d:hp:s:t:D:V" PPC_OPTS,
+ c = getopt_long(argc, argv, "+ab:c:d:hp:s:t:D:SV" PPC_OPTS,
long_opts, NULL);
if (c == -1)
break;
@@ -424,6 +428,10 @@ static bool parse_options(int argc, char *argv[])
fprintf(stderr, "Invalid slave address '%s'\n", optarg);
break;
+ case 'S':
+ progress_shutup();
+ break;
+
case 'D':
pdbg_set_loglevel(atoi(optarg));
break;
OpenPOWER on IntegriCloud