From e9509621999064c403911257daf2d72cb9d6772e Mon Sep 17 00:00:00 2001 From: Angelo Naselli Date: Sun, 3 May 2015 23:20:16 +0200 Subject: Added Shared functions to manage common command line options --- scripts/mana | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'scripts/mana') diff --git a/scripts/mana b/scripts/mana index 37c6db95..76f903f1 100755 --- a/scripts/mana +++ b/scripts/mana @@ -23,18 +23,12 @@ #***************************************************************************** use ManaTools::Privileges; +use ManaTools::Shared; use ManaTools::Shared::Locales; -use yui; -my $cmdline = new yui::YCommandLine; -my $locale_dir = undef; -my $pos = $cmdline->find("--locales-dir"); -if ($pos > 0) -{ - $locale_dir = $cmdline->arg($pos+1); -} -my $loc = ManaTools::Shared::Locales->new( +my $locale_dir = ManaTools::Shared::custom_locale_dir(); +my $loc = ManaTools::Shared::Locales->new( domain_name => 'manatools', dir_name => $locale_dir, ); @@ -87,7 +81,7 @@ my %modules = ( }, ); -usage() if($cmdline->find("--help") > 0 || $cmdline->find("-h") > 0); +usage() if ManaTools::Shared::help_requested() ; usage() if scalar(@ARGV) < 1; my $cmd = $ARGV[0]; -- cgit v1.2.1