Lines Matching refs:cmdl
70 char *shift_cmdl(struct cmdl *cmdl) in shift_cmdl() argument
74 if (cmdl->optind < cmdl->argc) in shift_cmdl()
75 next = (cmdl->optind)++; in shift_cmdl()
77 next = cmdl->argc; in shift_cmdl()
79 return cmdl->argv[next]; in shift_cmdl()
83 int parse_opts(struct opt *opts, struct cmdl *cmdl) in parse_opts() argument
88 for (i = cmdl->optind; i < cmdl->argc; i++) { in parse_opts()
91 o = find_opt(opts, cmdl->argv[i]); in parse_opts()
94 cmdl->argv[i]); in parse_opts()
98 cmdl->optind++; in parse_opts()
102 o->val = cmdl->argv[i]; in parse_opts()
103 cmdl->optind++; in parse_opts()
110 const struct cmd *cmds, struct cmdl *cmdl, void *data) in run_cmd() argument
115 if ((cmdl->optind) >= cmdl->argc) { in run_cmd()
117 (caller->help)(cmdl); in run_cmd()
120 name = cmdl->argv[cmdl->optind]; in run_cmd()
121 (cmdl->optind)++; in run_cmd()
127 (caller->help)(cmdl); in run_cmd()
135 return (cmd->func)(nlh, cmd, cmdl, data); in run_cmd()