rt 4.2.14 (#13852)
[freeside.git] / rt / devel / tools / rt-attributes-editor
index d344317..fc7a2cf 100644 (file)
@@ -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
 #                                          <sales@bestpractical.com>
 #
 # (Except where explicitly superseded by other copyright notices)
 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 );