Loading repository data…
Loading repository data…
UsboKirishima / repository
Wimey is a lightweight C library for building command-line tools with ease. It supports both command and argument parsing, including value handling, automatic help generation, and type-safe conversions. Designed for flexibility and minimal dependencies, Wimey helps you structure your CLI programs cleanly and efficiently.
Wimey is a simple-to-use C library to parse commands and arguments, written in less <600 Lines of Code. It supports both command and argument parsing, including value handling, automatic help generation, and type-safe conversions. Designed for flexibility and minimal dependencies, Wimey helps you structure your CLI programs cleanly and efficiently.
#include <stdio.h>
#include "wimey.h"
int main(int argc, char **argv) {
// Init Wimey
if (wimey_init() != WIMEY_OK) {
ERR("Init failed");
return 1;
}
// Config
struct wimey_config_t cfg = {
.name = "Example",
.description = "Minimal Wimey example",
.version = "0.1",
.log_level = LOG_ALL
};
wimey_set_config(&cfg);
// Add inline command
wimey_add_command((struct wimey_command_t){
.key = "hello",
.has_value = true,
.is_value_required = true,
.value_name = "name",
.desc = "Say hello",
.callback = [](const char *val) {
INFO("Hello, %s!", val);
}
});
// Parse args
wimey_parse(argc, argv);
// Clean up
wimey_free_all();
return 0;
}
Please read the full example here.
Clone repo:
git clone https://github.com/UsboKirishima/wimey && cd wimey
Move file to your project:
mv wimey.c ~/coding/myproj
mv wimey.h ~/coding/myproj
Inlude header file``
/* my_file.c */
#include "wimey.h"
// or with -Iinclude
#include <wimey.h>
Please open a pull request or issue, thanks!
Library under Apache 2.0 License Copyright (C) 2025 Davide Usberti usbertibox@gmail.com