about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xleo.pl36
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.}
 }
href='#n137'>137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237