#!/var/cfengine/bin/cf-agent -KIf-
# Example showing how bundle __main__ works
# This file can be used as the main entry (`cf-agent -KIf ./main_library.cf`)
# This file can also be included from another policy file containing __main__
bundle agent libprint(message)
# @brief report `message`
{
  reports:
    "Library: $(message).";
}

bundle agent __main__
# @brief Run this bundle (a testsuite) if this file is the entry
# This bundle is special. It is ignored unless it is the policy entry file
{
  methods:
    "test" usebundle => libprint("ok 1 - libprint works");
}

#@ The policy promises to call libprint to report that it works when the policy file is the main entry.
#+begin_src example_output
#@ ```
#@ R: Library: ok 1 - libprint works
#@ ```
#+end_src
