A.20 library(main): Provide entry point for scripts
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(main): Provide entry point for scripts
          • main/0
          • argv_options/3
    • Packages
Availability::- use_module(library(main)).(can be autoloaded)
Source[det]argv_options(+Argv, -RestArgv, -Options)
Generic transformation of long commandline arguments to options. Each --Name=Value is mapped to Name(Value). Each plain name is mapped to Name(true), unless Name starts with no-, in which case the option is mapped to Name(false). Numeric option values are mapped to Prolog numbers.
See also
library(optparse) provides a more involved option library, providing both short and long options, help and error handling. This predicate is more for quick-and-dirty scripts.