static int flag_usage(const struct ymd_flag_entry *p, const char *usage, const char *arg0) { const char *x = strrchr(arg0, '/'); if (x) arg0 = x + 1; if (usage) ymd_printf("Usage:\n%s\n", usage); ymd_printf("${[purple]%s}$ Options:\n", arg0); while (p->flag) { ymd_printf(" --${[!green]%s}$=${[!yellow]%s}$\n %s\n", p->flag, flag_input_info(p), p->desc); ++p; } exit(0); return 0; }
static int test_print_display() { ymd_printf("<0>"yRED"<red>"yEND"\n"); ymd_printf("<1>"yGREEN"<green>"yEND"\n"); ymd_printf("<2>"yYELLOW"<yellow>"yEND"\n"); ymd_printf("<3>"yBLUE"<blue>"yEND"\n"); ymd_printf("<4>"yPURPLE"<purple>"yEND"\n"); ymd_printf("<5>"yAZURE"<azure>"yEND"\n"); ymd_printf("<6>"yDRED"<deep red>"yEND"\n"); ymd_printf("<7>"yDGREEN"<deep green>"yEND"\n"); ymd_printf("<8>"yDYELLOW"<deep yellow>"yEND"\n"); ymd_printf("<9>"yDBLUE"<deep blue>"yEND"\n"); ymd_printf("<A>"yDPURPLE"<deep purple>"yEND"\n"); ymd_printf("<B>"yDAZURE"<deep azure>"yEND"\n"); ymd_set_colored(0); ymd_printf("<0>"yRED"<red>"yEND"\n"); ymd_printf("<1>"yGREEN"<green>"yEND"\n"); ymd_printf("<2>"yYELLOW"<yellow>"yEND"\n"); ymd_printf("<3>"yBLUE"<blue>"yEND"\n"); ymd_printf("<4>"yPURPLE"<purple>"yEND"\n"); ymd_printf("<5>"yAZURE"<azure>"yEND"\n"); ymd_printf("<6>"yDRED"<deep red>"yEND"\n"); ymd_printf("<7>"yDGREEN"<deep green>"yEND"\n"); ymd_printf("<8>"yDYELLOW"<deep yellow>"yEND"\n"); ymd_printf("<9>"yDBLUE"<deep blue>"yEND"\n"); ymd_printf("<A>"yDPURPLE"<deep purple>"yEND"\n"); ymd_printf("<B>"yDAZURE"<deep azure>"yEND"\n"); ymd_set_colored(1); return 0; }
static int test_print_format() { ymd_printf(yAZURE"<0>"yEND yRED"[%u]:"yEND yPURPLE"[%s]:"yEND"%s\n", 0xffffffff, "Hello, World!", "Suck is huge!"); return 0; }