summaryrefslogtreecommitdiff
path: root/zup.c
diff options
context:
space:
mode:
authorThomas Albers <thomas@thomaslabs.org>2023-08-10 11:12:23 +0200
committerThomas Albers <thomas@thomaslabs.org>2023-08-10 11:12:23 +0200
commit932424af0aadcfcc9dcf3f66ff844fea6ac53986 (patch)
tree9f8ae78e06e3457ffdc0a0214da0b39638e65811 /zup.c
parent312dea1d673365656cf98d282fb2bce64289a11d (diff)
Add progress option to write command
Diffstat (limited to 'zup.c')
-rw-r--r--zup.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/zup.c b/zup.c
index 844a693..d3acc54 100644
--- a/zup.c
+++ b/zup.c
@@ -97,17 +97,18 @@ parse_baud(const char *str)
static int
parse_options(int argc, char *const argv[])
{
- const char *sopts = "b:p:hHVRrv";
+ const char *sopts = "b:p:hHVPRrv";
const struct option lopts[] = {
- { "baud", required_argument, 0, 'b'},
- { "verbose", no_argument, 0, 'v'},
- { "version", no_argument, 0, 'V'},
- { "raw", no_argument, 0, 'r'},
- { "repl", no_argument, 0, 'R'},
- { "port", required_argument, 0, 'p'},
- { "human-readable", no_argument, 0, 'H'},
- { "help", no_argument, 0, 'h'},
- { 0, 0, 0, 0 }
+ {"baud", required_argument, 0, 'b'},
+ {"verbose", no_argument, 0, 'v'},
+ {"version", no_argument, 0, 'V'},
+ {"raw", no_argument, 0, 'r'},
+ {"repl", no_argument, 0, 'R'},
+ {"port", required_argument, 0, 'p'},
+ {"progress", no_argument, 0, 'P'},
+ {"human-readable", no_argument, 0, 'H'},
+ {"help", no_argument, 0, 'h'},
+ { 0, 0, 0, 0 }
};
int c;
@@ -130,6 +131,10 @@ parse_options(int argc, char *const argv[])
strncpy(param.port, optarg, LEN(param.port));
break;
+ case 'P':
+ param.show_progress = 1;
+ break;
+
case 'R':
param.repl = 1;
break;
@@ -215,7 +220,8 @@ struct param param = {
.baud = B9600,
.verbose = 0,
.human_readable = 0,
- .repl = 0
+ .repl = 0,
+ .show_progress = 0
};
// TODO: Support stdin/stdout