Add note about acks option

This commit is contained in:
Empathic Qubit 2022-12-27 20:39:00 +01:00
parent ea9665a100
commit 8f0f9dbc3c
2 changed files with 20 additions and 4 deletions

View file

@ -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);

View file

@ -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}
};