Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flagArgument not being markes as isset #24

Open
mkrasselt1 opened this issue Sep 25, 2024 · 0 comments
Open

flagArgument not being markes as isset #24

mkrasselt1 opened this issue Sep 25, 2024 · 0 comments

Comments

@mkrasselt1
Copy link

cmdWiFi = cli.addBoundlessCommand("wifi");
cmdWiFi.setDescription(" manages the wifi connection");
cmdWiFi.addFlagArg("scan");
cmdWiFi.addFlagArg("connect");
cmdWiFi.addPosArg("ssid", "SSID");
cmdWiFi.addPosArg("pass/word", "PASSWORD");
String input = "wifi -scan";
cli.parse(cliInput);
if (cli.available()){
    Command c = cli.getCmd();
    if (c = cmdWiFi){
      Argument argScan = c.getArgument("scan");
      if(argScan.isSet()){
        Serial.println("should return true");
      }else{
       Serial.println("but dosnt");
      }
      Argument arg1 = c.getArgument(1);
      if(arg1.isSet()){
        Serial.println("but this does");
      }else{
       Serial.println("as expected ");
      }
    }

Cant explain this behaviour?
Any ideas ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant