X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fdevel%2Ftools%2Frt-attributes-editor;h=fc7a2cf164de8b4e694c24cc76f0b543a77dfff4;hp=d3443177af25d627855024caa1bb7ce16aaa7211;hb=de9d037528895f7151a9aead6724ce2df95f9586;hpb=7588a4ac90a9b07c08a3107cd1107d773be1c991 diff --git a/rt/devel/tools/rt-attributes-editor b/rt/devel/tools/rt-attributes-editor index d3443177a..fc7a2cf16 100644 --- a/rt/devel/tools/rt-attributes-editor +++ b/rt/devel/tools/rt-attributes-editor @@ -3,7 +3,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -49,19 +49,12 @@ use strict; use warnings; use Term::EditorEdit; -use Getopt::Long; -my ($help, $key, $id); -GetOptions('help|h' => \$help, 'key|k=s' => \$key, 'id=i' => \$id); -if ( $help || !$id ) { - require Pod::Usage; - Pod::Usage::pod2usage({ verbose => 2 }); - exit; -} +use RT::Interface::CLI qw(Init); +my ($key, $id); +Init('key|k=s' => \$key, 'id=i' => \$id); -require RT; -RT::LoadConfig(); -RT::Init(); +Pod::Usage::pod2usage({ verbose => 2 }) unless $id; require RT::Attribute; my $attr = RT::Attribute->new( RT->SystemUser );