Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time


How to create a string flag?

Flag in _oasis are only boolean. As of OASIS 0.4.7, there is no way to define a string flag. A string flag, can be useful when you want e.g. CCOpt: -D $(STR).

The reason why this has not been done are:

  • boolean flags are easy to switch on and off to test various branches, which can allow auto exploration for the package.
  • string flags would require a way to validate them, make sure that quoting is correct when they are used in substitution.
  • string flags are easily implementable directly in

The quick solution to have a string flag FOO is to add the following code to

let _ = BaseEnv.var_define "FOO" (fun _ -> "123");;
let () = setup ();;

This can be used like this:

Executable "opam-build-revdeps"
  Path: src/bin/opam-build-revdeps
  CompiledObject: best
  CCOpt:-D $(FOO)

The value of the flag FOO can be set through command line and environment variable.