Converts a {@link io.devcon5.cli.CliOption} into a {@link org.apache.commons.cli.Option}.

@param cliParam
the cli annotation to convert

@return the Apache CLI Option instance.
979059
private Option toOption(CliOption cliParam) {
        Option.Builder builder = builder(cliParam.value()).hasArg(cliParam.hasArg())
                                                          .required(cliParam.required());
        if (!cliParam.longOpt().isEmpty()) {
            builder.longOpt(cliParam.longOpt());
        }

        if (!cliParam.desc().isEmpty()) {
            builder.desc(cliParam.desc());
        }

        return builder.build();
    }
384908
private void parseParameterUndefinedOption(String parameter, CliParserState parserState, CliParameterConsumer parameterConsumer) {

    if (END_OPTIONS.equals(parameter)) {
      parserState.setOptionsComplete();
      return;
    }

    CliStyleHandling handling = this.cliState.getCliStyle().optionMixedShortForm();
    Matcher matcher = PATTERN_MIXED_SHORT_OPTIONS.matcher(parameter);
    if (matcher.matches()) {
      // "-vlp" --> "-v", "-l", "-p"
      RuntimeException mixedOptions = null;
      if (handling != CliStyleHandling.OK) {
        // TODO: declare proper exception for this purpose...
        mixedOptions = new NlsIllegalArgumentException("Mixed options (" + parameter + ") should be avoided.");
      }
      handling.handle(getLogger(), mixedOptions);

      String multiOptions = matcher.group(1);
      for (int i = 0; i < multiOptions.length(); i++) {
        String subArgument = PREFIX_SHORT_OPTION + multiOptions.charAt(i);
        parseParameter(subArgument, parserState, CliParameterConsumer.EMPTY_INSTANCE);
      }
    } else if (parameter.startsWith(PREFIX_SHORT_OPTION)) {
      throw new CliOptionUndefinedException(parameter);
    } else {
      // so it seems the options are completed and this is a regular argument
      parserState.setOptionsComplete();
      parseParameter(parameter, parserState, parameterConsumer);
    }
  }
665664
public alluxio.grpc.RenamePOptionsOrBuilder getOptionsOrBuilder() {
    return options_ == null ? alluxio.grpc.RenamePOptions.getDefaultInstance() : options_;
  }
691265
@SuppressWarnings("JavadocReference")
    protected Map<String, Object> getNewOptionsByName(ResourceOptions options, Map<String, Object> optionsByName) {
        Map<String,Object> clonedOptionsByName = new HashMap<>(optionsByName);
        clonedOptionsByName.put(NEXT_PROTOCOL.name(), options.getOption(NEXT_PROTOCOL));
        clonedOptionsByName.put(QUALIFIER.name(), options.getOption(QUALIFIER));
        clonedOptionsByName.put(TRANSPORT_URI.name(), options.getOption(TRANSPORT_URI));
        clonedOptionsByName.put(BIND_ALTERNATE.name(), options.getOption(BIND_ALTERNATE));
        clonedOptionsByName.put(RESOLVER.name(), options.getOption(RESOLVER));

        return clonedOptionsByName;
    }
1266251
private static void generateOptionsFromBuilderApi(Class<?> apiNode, Set<Class<?>> processedApiNodes, List<CliDeclaredOptionSpec> cliOptionsFoundSoFar) {
		if (processedApiNodes.contains(apiNode)) {
			return;
		}
		
		processedApiNodes.add(apiNode);
		
		for (Method m : ClassUtils.collectMethods(apiNode, apiNode, of(MethodModifier.PUBLIC))) {
			if (methodIsCliCompatible(m)) {
				final String optionName = determineCliOptionName(apiNode, m);
				LOGGER.debug("option {} found for {}.{}({})", optionName, apiNode.getSimpleName(), m.getName(), m.getParameterTypes());
				
				// assertion check
				for (CliDeclaredOptionSpec knownOption : cliOptionsFoundSoFar) {
					if (knownOption.getName().equals(optionName)) {
						String msg = "@CliOptionNameOverride needed one of the following two methods:\n\t%s\n\t%s\n\t----------";
						throw new AssertionError(format(msg, knownOption.getSourceMethod(), m));
					}
				}
				
				cliOptionsFoundSoFar.add(new CliDeclaredOptionSpec(
						optionName,
						TherapiJavadocHelper.determineCliOptionDescriptions(m),
						getArgumentsForCliOption(m),
						apiNode.getAnnotation(Cli.BuilderApiNode.class).builderApiType(),
						m));
				Class<?> potentialNestedApiNode = m.getReturnType();
				if (potentialNestedApiNode.isAnnotationPresent(Cli.BuilderApiNode.class)) {
					generateOptionsFromBuilderApiChain(potentialNestedApiNode, processedApiNodes, cliOptionsFoundSoFar);
				}
			} else {
				LOGGER.debug("Method not CLI compatible: {}.{}({})", apiNode.getSimpleName(), m.getName(), Arrays.toString(m.getParameterTypes()));
			}
		}
	}
385124
@SuppressWarnings("deprecation")
    @SuppressLint("NewApi")
    private void addLinkToClipBoard(String url, String label) {
        int sdk = android.os.Build.VERSION.SDK_INT;
        if (sdk < android.os.Build.VERSION_CODES.HONEYCOMB) {
            android.text.ClipboardManager clipboard = (android.text.ClipboardManager) context_.getSystemService(Context.CLIPBOARD_SERVICE);
            clipboard.setText(url);
        } else {
            android.content.ClipboardManager clipboard = (android.content.ClipboardManager) context_.getSystemService(Context.CLIPBOARD_SERVICE);
            android.content.ClipData clip = android.content.ClipData.newPlainText(label, url);
            clipboard.setPrimaryClip(clip);
        }
        Toast.makeText(context_, builder_.getUrlCopiedMessage(), Toast.LENGTH_SHORT).show();
    }
440449
public alluxio.grpc.CreateDirectoryPOptionsOrBuilder getOptionsOrBuilder() {
    return options_ == null ? alluxio.grpc.CreateDirectoryPOptions.getDefaultInstance() : options_;
  }
1102165
public alluxio.grpc.GetUfsInfoPOptionsOrBuilder getOptionsOrBuilder() {
    return options_ == null ? alluxio.grpc.GetUfsInfoPOptions.getDefaultInstance() : options_;
  }
1309074
public alluxio.grpc.GetFileInfoPOptionsOrBuilder getOptionsOrBuilder() {
    return options_ == null ? alluxio.grpc.GetFileInfoPOptions.getDefaultInstance() : options_;
  }
374922
def on_clipboard_mode_change(self, clipboard_mode):
        
        if not isinstance(clipboard_mode, ClipboardMode):
            raise TypeError("clipboard_mode can only be an instance of type ClipboardMode")
        self._call("onClipboardModeChange",
                     in_p=[clipboard_mode])
490062
function(clipData) {
    var newClipData = {}, formatMap = {};
    if (!(typeof clipData === "object" && clipData)) {
      return;
    }
    for (var dataFormat in clipData) {
      if (dataFormat && _hasOwn.call(clipData, dataFormat) && typeof clipData[dataFormat] === "string" && clipData[dataFormat]) {
        switch (dataFormat.toLowerCase()) {
         case "text/plain":
         case "text":
         case "air:text":
         case "flash:text":
          newClipData.text = clipData[dataFormat];
          formatMap.text = dataFormat;
          break;

         case "text/html":
         case "html":
         case "air:html":
         case "flash:html":
          newClipData.html = clipData[dataFormat];
          formatMap.html = dataFormat;
          break;

         case "application/rtf":
         case "text/rtf":
         case "rtf":
         case "richtext":
         case "air:rtf":
         case "flash:rtf":
          newClipData.rtf = clipData[dataFormat];
          formatMap.rtf = dataFormat;
          break;

         default:
          break;
        }
      }
    }
    return {
      data: newClipData,
      formatMap: formatMap
    };
  }
49389
public alluxio.grpc.RemovePathConfigurationPOptionsOrBuilder getOptionsOrBuilder() {
    return options_ == null ? alluxio.grpc.RemovePathConfigurationPOptions.getDefaultInstance() : options_;
  }
393748
@Pure
	public static List<Object> getCommandLineOption(String name) {
		if (commandLineOptions != null && commandLineOptions.containsKey(name)) {
			final List<Object> value = commandLineOptions.get(name);
			return value == null ? Collections.emptyList() : value;
		}
		return Collections.emptyList();
	}
316464
public Object getOptionValue( String name )
    {
        if (!hasOptionValue( name )) throw new IllegalArgumentException( "Don't know option: " + name );
        return getOptionValues().get( name );
    }
857948
protected CliParserBuilder getParserBuilder() {

    if (this.parserBuilder == null) {
      DefaultCliParserBuilder impl = new DefaultCliParserBuilder();
      impl.initialize();
      this.parserBuilder = impl;
    }
    return this.parserBuilder;
  }
595937
public String clipString(String str, int width, FontOptions options)
	{
		return clipString(str, width, options, false);
	}
544541
public ConfigOptionBuilder setCommandLineOptionWithArgument( CommandLineOption commandLineOption, StringConverter converter ) {
        co.setCommandLineOption( commandLineOption );
        return setStringConverter( converter );
    }