From d65bbb083e437bf44fa42d33f25ca73ec05d16eb Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem Date: Thu, 25 Apr 2024 18:48:16 +0200 Subject: [PATCH 1/2] README.md: Simplified hello world example There's no need to try to introduce as much syntax as possible in this example. Hello world can and should be simple. Changelog: None Ticket: None Signed-off-by: Ole Herman Schumacher Elgesem --- README.md | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 4a122e9869..7bd5933ef5 100644 --- a/README.md +++ b/README.md @@ -48,28 +48,24 @@ $ pwd /core $ echo "cd $(pwd); cf-promises/cf-promises \"\$@\"" > ~/.cfagent/bin/cf-promises - ### Hello World The following code demonstrates simple CFEngine output through a reports promise. - body common control - { - bundlesequence => { "run" }; - } - - bundle agent run - { - reports: - cfengine:: - "Hello, world"; - } +```cfengine3 +bundle agent main +{ + reports: + "Hello, world"; +} +``` The following policy code may be executed with cf-agent (the main CFEngine binary) as follows. - $ cf-agent/cf-agent hello.cf - R: Hello, world - +```bash +$ cf-agent/cf-agent hello.cf +R: Hello, world +``` ## Debugging From 0292743ce0db505255a83af187d91a5c39410420 Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem <4048546+olehermanse@users.noreply.github.com> Date: Thu, 25 Apr 2024 19:22:45 +0200 Subject: [PATCH 2/2] Nick added ./ in front of hello.cf Co-authored-by: Nick Anderson --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7bd5933ef5..823fe0dbf4 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ bundle agent main The following policy code may be executed with cf-agent (the main CFEngine binary) as follows. ```bash -$ cf-agent/cf-agent hello.cf +$ cf-agent/cf-agent ./hello.cf R: Hello, world ```