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.}
 }
blame/themes/orange?id=9792f3ddc9cb6b3c86e9915a30cfc98626ad00c3'>^
30b5f112 ^





7915c54f ^





30b5f112 ^
71679a31 ^

7915c54f ^


7915c54f ^
30b5f112 ^
2f82f50a ^
86c1c388 ^
1a3dc91e ^
30b5f112 ^

44112f6c ^
fbc30231 ^

















cd2458c0 ^

0ae975c2 ^

b21edfaa ^
cd2458c0 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79