git: 38bb6f79e39a - main - nuageinit: Standardize user-facing error messages

From: Baptiste Daroussin <bapt_at_FreeBSD.org>
Date: Thu, 26 Sep 2024 11:06:19 UTC
The branch main has been updated by bapt:

URL: https://cgit.FreeBSD.org/src/commit/?id=38bb6f79e39a14ea99f559f59129a4cadf92b569

commit 38bb6f79e39a14ea99f559f59129a4cadf92b569
Author:     Jose Luis Duran <jlduran@gmail.com>
AuthorDate: 2024-07-30 01:59:16 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2024-09-26 10:59:24 +0000

    nuageinit: Standardize user-facing error messages
    
    Signed-off-by: Jose Luis Duran <jlduran@gmail.com>
---
 libexec/nuageinit/nuageinit          | 2 +-
 libexec/nuageinit/tests/nuageinit.sh | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit
index 8c289fea6b1d..c8f74d13b7fd 100755
--- a/libexec/nuageinit/nuageinit
+++ b/libexec/nuageinit/nuageinit
@@ -9,7 +9,7 @@ local ucl = require("ucl")
 local yaml = require("yaml")
 
 if #arg ~= 2 then
-	nuage.err("Usage " .. arg[0] .. " <cloud-init directory> [config-2|nocloud]", false)
+	nuage.err("Usage: " .. arg[0] .. " <cloud-init-directory> (<config-2> | <nocloud>)", false)
 end
 local path = arg[1]
 local citype = arg[2]
diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh
index f3fc55e87523..6b8ea7ff3328 100644
--- a/libexec/nuageinit/tests/nuageinit.sh
+++ b/libexec/nuageinit/tests/nuageinit.sh
@@ -19,9 +19,9 @@ atf_test_case config2_network_static_v4
 
 args_body()
 {
-	atf_check -s exit:1 -e inline:"Usage /usr/libexec/nuageinit <cloud-init directory> [config-2|nocloud]\n" /usr/libexec/nuageinit
-	atf_check -s exit:1 -e inline:"Usage /usr/libexec/nuageinit <cloud-init directory> [config-2|nocloud]\n" /usr/libexec/nuageinit bla
-	atf_check -s exit:1 -e inline:"Usage /usr/libexec/nuageinit <cloud-init directory> [config-2|nocloud]\n" /usr/libexec/nuageinit bla meh plop
+	atf_check -s exit:1 -e inline:"Usage: /usr/libexec/nuageinit <cloud-init-directory> (<config-2> | <nocloud>)\n" /usr/libexec/nuageinit
+	atf_check -s exit:1 -e inline:"Usage: /usr/libexec/nuageinit <cloud-init-directory> (<config-2> | <nocloud>)\n" /usr/libexec/nuageinit bla
+	atf_check -s exit:1 -e inline:"Usage: /usr/libexec/nuageinit <cloud-init-directory> (<config-2> | <nocloud>)\n" /usr/libexec/nuageinit bla meh plop
 	atf_check -s exit:1 -e inline:"nuageinit: Unknown cloud init type: meh\n" /usr/libexec/nuageinit bla meh
 }