ULOS Manual Pages - config(3) | Back

NAME
  config - configuration library

DESCRIPTION
  config is a library for generalized application configuration.  It uses configuration templates, or objects with :load() and :save() methods.

FUNCTIONS
  These functions are common across all configuration templates.  All functions return nil and an error:string on failure.

  load(file:string): table
    Returns a format-specific table representation of the configuration file.

  save(file:string, data:table): boolean
    Saves the provided data to the specified file.

FORMATS
  The following formats are supported by the config library.

  table
    Serialized Lua tables.  The returned table will be identical to what is represented by the file.  Uses serializer(3) for saving.

  bracket
    A style of configuration similar to that of the Refinement init system.  See the below example.

      [header]
      key1=value2
      key2="value that is a string"
      key10 = ["table", of,values]

    The returned table will be in the format { header = { key1 = "value2", key2 = "value that is a string", key10 = { "table", "of", "values" } } }.

COPYRIGHT
  Config library copyright (c) 2021 Ocawesome101 under the DSLv2.

REPORTING BUGS
  Bugs should be reported at https://github.com/ocawesome101/oc-ulos/issues.