module sdf/tools/options
strategies

  sdf-main-module-option =
    sdf-main-module-option(!"Specify main module in sdf definition")

  sdf-main-module-option(s) =
    ArgOption("-m" + "--main"
    , where(<set-config> (SdfMainModuleFlag(), <id>))
    , <concat-strings> ["-m mod | --main mod   ", <s> (), " [Main]"]
    )

  pass-sdf-main-module =
    !["--main", <get-sdf-main-module>]

  get-sdf-main-module =
    <get-config> SdfMainModuleFlag() <+ !"Main"

  sdf-main-module-error =
      say(!<concat-strings> ["** ERROR -- Specified main module (", <get-sdf-main-module> (), ") not found in definition"])
    ; fail

signature
  constructors
    SdfMainModuleFlag : Flag
