From 5673efeb946c6b417b8906c2d235aa880ccdee7e Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 1 Mar 2026 11:56:54 -0400 Subject: [PATCH] v0.0.17 - Add -h/-v CLI flags and make post_readme_to_nostr skill call nostr_post_readme tool --- README.md | 4 ++-- src/main.c | 16 ++++++++++++++-- src/main.h | 4 ++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9ae4dd7..4f38d0c 100644 --- a/README.md +++ b/README.md @@ -51,11 +51,11 @@ Agents learn capabilities through skills — Nostr events that any agent can di Didactyl will support local inference, which is very privacy preserving. Remote inference does however have it's advantages, and in those cases Didactyl supports using Bitcoin Lightning and eCash inference providers. -## Current Status — v0.0.16 +## Current Status — v0.0.17 **Active build — this project is barely working. Experiment at your own risk.** -> Last release update: v0.0.16 — Add deterministic nostr_post_readme tool to publish full README with d tag readme.md +> Last release update: v0.0.17 — Add -h/-v CLI flags and make post_readme_to_nostr skill call nostr_post_readme tool - Connects to configured relays with auto-reconnect and relay state transition logging - Publishes configured startup events per relay as each relay becomes connected diff --git a/src/main.c b/src/main.c index 66a1469..17a4eb4 100644 --- a/src/main.c +++ b/src/main.c @@ -20,17 +20,29 @@ static void signal_handler(int signum) { g_running = 0; } +static void print_usage(const char* prog) { + fprintf(stderr, + "Usage: %s [-h|--help] [-v|--version] [--config ] [--debug <0-5>]\n", + prog ? prog : "didactyl"); +} + int main(int argc, char** argv) { const char* config_path = "./config.json"; int debug_level = DEBUG_LEVEL_TRACE; for (int i = 1; i < argc; i++) { - if (strcmp(argv[i], "--config") == 0 && i + 1 < argc) { + if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) { + print_usage(argv[0]); + return 0; + } else if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--version") == 0) { + printf("%s %s\n", DIDACTYL_NAME, DIDACTYL_VERSION); + return 0; + } else if (strcmp(argv[i], "--config") == 0 && i + 1 < argc) { config_path = argv[++i]; } else if (strcmp(argv[i], "--debug") == 0 && i + 1 < argc) { debug_level = atoi(argv[++i]); } else { - fprintf(stderr, "Usage: %s [--config ] [--debug <0-5>]\n", argv[0]); + print_usage(argv[0]); return 1; } } diff --git a/src/main.h b/src/main.h index c2baba7..a848dd2 100644 --- a/src/main.h +++ b/src/main.h @@ -12,8 +12,8 @@ // Using DIDACTYL_ prefix to avoid conflicts with nostr_core_lib VERSION macros #define DIDACTYL_VERSION_MAJOR 0 #define DIDACTYL_VERSION_MINOR 0 -#define DIDACTYL_VERSION_PATCH 16 -#define DIDACTYL_VERSION "v0.0.16" +#define DIDACTYL_VERSION_PATCH 17 +#define DIDACTYL_VERSION "v0.0.17" // Agent metadata #define DIDACTYL_NAME "Didactyl"