#include <k/cli.h>
#include <k/io.h>
#include <k/str.h>

kcond
kcli_usage(kcli_set prg, kiochan ch) {
	ubyte buf_space [sizeof(ksbuf) + 256];
	ksbuf* out = ksbufmk(buf_space, ch, 256);

	const char* msg [] = {
		prg.name, " v", prg.version, "\n\n",
		prg.desc, "\n\n",
	};
	for (sz i = 0; i != Kmsz(msg); ++ i) {
		ksraw str = { 0, msg[i] };
		kcond c = ksbufput(out, str);
	}
	
	return ksbufflush(out);
}
