code: public static PinPullResistance getPinPullResistance(PinPullResistance defaultPull, String ... args){
  
          // search all arguments for the argument option designators
          for(int index = 0; index < args.length; index++){
  
              if(args[index].toLowerCase().equals("--up")){
                  return PinPullResistance.PULL_UP;
              }
              else if(args[index].toLowerCase().equals("--down")){
                  return PinPullResistance.PULL_DOWN;
              }
              else if(args[index].toLowerCase().equals("--pull") ||
                      args[index].toLowerCase().equals("-l")){
                  // if using this option designator, we must have an additional
                  // argument in the array to read the value from
                  if(index < (args.length-1)){
                      String pull = args[index+1].toLowerCase();
                      if(pull.equals("up")){
                          return PinPullResistance.PULL_UP;
                      }
                      else if(pull.equals("1")){
                          return PinPullResistance.PULL_UP;
                      }
                      else if(pull.equals("down")){
                          return PinPullResistance.PULL_DOWN;
                      }
                      else if(pull.equals("0")){
                          return PinPullResistance.PULL_DOWN;
                      }
                      else{
                          return PinPullResistance.OFF;
                      }
                  }
              }
          }
          return defaultPull;
      }
docs: This utility method searches for "--pull (up|down|off)", "--l (up|down|off)", "--up", or "--down" in the command
  arguments array and returns a PinPullResistance instance based on the option
  value provided.
  
  @param defaultPull default pin pull resistance to apply if no option/argument is found
  @param args the argument array to search in
  @return pill pull resistance enum