From e64552a316defc442a154469c9a18e82d2447cac Mon Sep 17 00:00:00 2001
From: Guillaume Rousse <guillaume.rousse@renater.fr>
Date: Mon, 30 Oct 2017 16:43:44 +0100
Subject: [PATCH] use Pod::Usage to display usage errors

---
 bin/account-manager-client.pl | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/bin/account-manager-client.pl b/bin/account-manager-client.pl
index be55875..8248735 100755
--- a/bin/account-manager-client.pl
+++ b/bin/account-manager-client.pl
@@ -14,6 +14,7 @@ use lib "/opt/testidp/IdPAccountManager/conf";
 
 use Getopt::Long qw(:config auto_help);
 use POSIX;
+use Pod::Usage;
 
 use IdPAccountManager::TestAccount;
 use IdPAccountManager::SAMLMetadata;
@@ -35,7 +36,10 @@ unless (
     )
   )
 {
-    die "Unknown options.";
+    pod2usage(
+        -message => "unknown option, aborting\n",
+        -verbose => 0
+    );
 }
 
 if ($options{'add_test_account'}) {
@@ -308,7 +312,10 @@ if ($options{'add_test_account'}) {
     printf "Mail notice sent to $options{'email_address'}\n";
 
 } else {
-    die "Missing arguments";
+    pod2usage(
+        -message => "missing argument, aborting\n",
+        -verbose => 0
+    );
 
 }
 
-- 
GitLab