From 8f0f9dbc3c41aff46cffc2d4b39b9d15742b4fb0 Mon Sep 17 00:00:00 2001 From: empathicqubit Date: Tue, 27 Dec 2022 20:39:00 +0100 Subject: [PATCH] Add note about acks option --- src/tibridge.c | 15 +++++++++++++++ src/tikeys.c | 9 +++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/tibridge.c b/src/tibridge.c index 5f43dea..c798e76 100644 --- a/src/tibridge.c +++ b/src/tibridge.c @@ -13,6 +13,15 @@ static pthread_t tid; static CableHandle* cable_handle; +void show_help() { + log(LEVEL_INFO, "Syntax: tibridge [--no-handle-acks|--handle-acks]\n"); + log(LEVEL_INFO, +"--no-handle-acks: By default, ACKs (-/+) will be hidden from the client.\n" +" This is necessary for working with z88dk-gdb. If you're\n" +" using a better client, you can disable this." + ); +} + int hex(char ch) { if ((ch >= 'a') && (ch <= 'f')) return (ch - 'a' + 10); @@ -90,6 +99,8 @@ int main(int argc, char *argv[]) { const struct option long_opts[] = { {"handle-acks", no_argument, &handle_acks, 1}, {"no-handle-acks", no_argument, &handle_acks, 0}, + + {"help", no_argument, 0, 'h'}, {0,0,0,0} }; @@ -100,6 +111,10 @@ int main(int argc, char *argv[]) { if(opt == 0 && long_opts[opt_index].flag) { // Do nothing } + else if(opt == 'h') { + show_help(); + return 0; + } } log(LEVEL_DEBUG, "handle acks: %d\n", handle_acks); diff --git a/src/tikeys.c b/src/tikeys.c index 6e4a28b..69a8ccb 100644 --- a/src/tikeys.c +++ b/src/tikeys.c @@ -20,6 +20,10 @@ static int reset_ram = 0; static CalcHandle *calc_handle = NULL; static CalcModel model = CALC_NONE; +void show_help() { + log(LEVEL_INFO, "Syntax: tikeys [--reset-ram] [--keys=ABCDEFG123456789] [--subtype=mirage --program=PROGNAME]\n"); +} + static void send_key(uint32_t key, int retry) { usleep(100000); int err; @@ -68,10 +72,6 @@ static int get_program_index(GNode *tree, char* program) { return -1; } -void show_help() { - log(LEVEL_INFO, "Syntax: tikeys [--reset-ram] [--keys=ABCDEFG123456789] [--subtype=mirage --program=PROGNAME]\n"); -} - int main(int argc, char *argv[]) { utils_parse_args(argc, argv); @@ -80,6 +80,7 @@ int main(int argc, char *argv[]) { {"program", required_argument, 0, 'p'}, {"keys", required_argument, 0, 'k'}, {"reset-ram", no_argument, &reset_ram, 1}, + {"help", no_argument, 0, 'h'}, {0,0,0,0} };