diff options
author | Andinus <andinus@nand.sh> | 2020-08-25 13:42:16 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2020-08-25 13:42:16 +0530 |
commit | 73a9e1fe3d9d91b88fd786c0a6d857beac47d3f7 (patch) | |
tree | b9b630774117174f9a765282f2bd19dbe70b00d4 | |
parent | 64fbc9a818a0d9d2f502e7b12b744863d09a568a (diff) | |
download | leo-73a9e1fe3d9d91b88fd786c0a6d857beac47d3f7.tar.gz |
Remove unused code, Term::ANSIColor
I moved these to a shell scripts again because it's much simpler. Term::ANSIColor is not really required.
-rwxr-xr-x | leo.pl | 36 |
1 files 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.} } |