From 73a9e1fe3d9d91b88fd786c0a6d857beac47d3f7 Mon Sep 17 00:00:00 2001 From: Andinus Date: Tue, 25 Aug 2020 13:42:16 +0530 Subject: Remove unused code, Term::ANSIColor I moved these to a shell scripts again because it's much simpler. Term::ANSIColor is not really required. --- leo.pl | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/leo.pl b/leo.pl index 37f620c..c7c6da7 100755 --- a/leo.pl +++ b/leo.pl @@ -4,34 +4,24 @@ use strict; use warnings; use feature 'say'; -use lib::relative 'lib'; -use Emacs; - -use FindBin; use Path::Tiny; use IPC::Run3; -use Getopt::Long qw/ GetOptions /; -use Term::ANSIColor qw/ :pushpop colored color /; - -local $SIG{__WARN__} = sub { print colored( $_[0], 'yellow' ); }; - -my %options = (); -GetOptions( - \%options, - qw{ verbose debug } -) or die "Error in command line arguments\n"; my %dispatch = ( - "sync emacs" => sub { $options{config} = 1; Emacs::sync(\%options); }, - "sync irclogs" => sub { $options{irclogs} = 1; Emacs::sync(\%options); }, - "sync authinfo" => sub { $options{authinfo} = 1; Emacs::sync(\%options); }, + "archive" => \&archive, ); -if ( $dispatch{ "@ARGV" } ) { - $dispatch{ "@ARGV" }->(); +if ( $ARGV[0] + and $dispatch{ $ARGV[0] } ) { + $dispatch{ $ARGV[0] }->(); +} elsif ( scalar @ARGV == 0 ) { + HelpMessage(); } else { - my $file = path($FindBin::RealBin . "/share/theo"); - my @insults = split/\n%\n/, $file->slurp; - print LOCALCOLOR RED "[ERR] " if $options{verbose}; - say LOCALCOLOR YELLOW $insults[ rand @insults ]; + say "leo: no such option"; +} + +sub HelpMessage { + say qq{Usage: + archive + Create an archive.} } -- cgit 1.4.1-2-gfad0