return CMD_RET_SUCCESS;
}
- /* reset getopt() */
- optind = 0;
-
int opt;
while ((opt = getopt(argc, argv, PSTR("darwo:"))) != -1) {
switch (opt) {
memcpy_P(&boot_param, cfboot, sizeof boot_param);
default_stages = boot_param.stages;
- /* reset getopt() */
- optind = 0;
-
int opt;
while ((opt = getopt(argc, argv, PSTR("vna:s:c:t:i:"))) != -1) {
switch (opt) {
uint32_t addr;
bool hold = 0;
- /* reset getopt() */
- optind = 0;
-
int opt;
while ((opt = getopt(argc, argv, PSTR("h"))) != -1) {
switch (opt) {
uint32_t pulsewidth = 10; /* ms */
- /* reset getopt() */
- optind = 0;
-
int opt;
while ((opt = getopt(argc, argv, PSTR("t:"))) != -1) {
switch (opt) {
char ch;
#if 0
- /* reset getopt() */
- optind = 0;
int opt;
while ((opt = getopt(argc, argv, PSTR("t:"))) != -1) {
switch (opt) {
uint8_t eimsk_save;
uint8_t mem_save[cpuinfo_length];
- /* reset getopt() */
- optind = 0;
-
int opt;
while ((opt = getopt(argc, argv, PSTR("swnuc:t:"))) != -1) {
switch (opt) {
uint_fast8_t pinarg[GPIO_MAX];
uint_fast8_t pinargc;
- /* reset getopt() */
- optind = 0;
-
int opt;
while ((opt = getopt(argc, argv, PSTR("s"))) != -1) {
switch (opt) {
(void) cmdtp; (void) flag;
- /* reset getopt() */
- optind = 0;
-
int opt;
while ((opt = getopt(argc, argv, PSTR("bwl"))) != -1) {
switch (opt) {
(void) cmdtp;
(void) flag;
- optind = 0;
if (argv[0][1] != 'd') {
int opt;
while ((opt = getopt(argc, argv, PSTR("bwl"))) != -1)
(void) cmdtp; (void) flag;
- /* reset getopt() */
- optind = 0;
-
int opt;
while ((opt = getopt(argc, argv, PSTR("n"))) != -1) {
switch (opt) {
#define OPT_USAGE 0x08
#define OPT_LONG 0x10
- /* reset getopt() */
- optind = 0;
-
int opt;
while ((opt = getopt(argc, argv, PSTR("afk"))) != -1) {
switch (opt) {
* @param argv Arguments
* @return 0 if command succeeded, else non-zero (CMD_RET_...)
*/
-command_ret_t cmd_call(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * const argv[])
+static command_ret_t cmd_call(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * const argv[])
{
command_ret_t result;
/* If OK so far, then do the command */
if (!rc) {
+ optind = 0; /* reset getopt() */
cmd_invocation_ptr = cmdtp;
rc = cmd_call(cmdtp, flag, argc, argv);
*repeatable &= (cmdtp->flags & CTBL_RPT) != 0;
bool mode = 0;
command_ret_t rc = CMD_RET_SUCCESS;
- /* reset getopt() */
- optind = 0;
-
int opt;
while ((opt = getopt(argc, argv, PSTR("s"))) != -1) {
switch (opt) {
#include "common.h" /* definition of FLASH */
#include <string.h>
-int optind = 0; /* next argv[] index */
+int optind; /* next argv[] index */
char *optarg; /* option parameter if any */