libk  Diff

Differences From Artifact [9c55c30fa9]:

To Artifact [92e78f7400]:


     1      1   #include <k/core.h>
     2      2   #include <k/cli.h>
     3      3   
     4      4   stat
     5      5   entry (kenv e) {
            6  +	kcli_flag verbose = false,
            7  +	          debug = false;
            8  +	
            9  +	kcli_opt options[] = {
           10  +		{ "v", "verbose", kcli_opt_flag, &verbose,
           11  +		  "induce information overload" },
           12  +		{ "d", "debug-mode", kcli_opt_flag, &debug,
           13  +		  "run the program in debug mode"},
           14  +	};
           15  +
           16  +	const char* perp, * place, * weapon;
           17  +
           18  +	kcli_param params[] = {
           19  +		{"perp", kcli_param_string, kcli_rule_required, &perp,
           20  +		 "the one who did the dastardly deed"},
           21  +		{"place", kcli_param_string, kcli_rule_required, &place,
           22  +		 "where the crime was committed"},
           23  +		{"murder weapon", kcli_param_string, kcli_rule_optional, &weapon,
           24  +		 "the implement used to murder the victim"},
           25  +	};
           26  +
     6     27   	kcli_set testbin = {
     7     28   		"testbin", "1.0.0", e.args, e.argc,
     8     29   		"this is a test of the kcli module",
           30  +		params, Kmsz(params),
           31  +		options, Kmsz(options),
     9     32   	};
    10     33   
    11     34   	kcond c = kcli_usage(testbin, e.err);
    12     35   
    13     36   	return c;
    14     37   }