move exec code to Client.pm, add get_homedir example to Takfile
[scpubgit/Tak.git] / lib / Tak / Script.pm
index 00208d2..446b434 100644 (file)
@@ -10,6 +10,8 @@ use Log::Contextual qw(:log);
 use Log::Contextual::SimpleLogger;
 use Moo;
 
+with 'Tak::Role::ScriptActions';
+
 has options => (is => 'ro', required => 1);
 has env => (is => 'ro', required => 1);
 
@@ -76,6 +78,7 @@ sub run {
     return $self->local_help;
   }
   my $cmd = shift(@argv);
+  $cmd =~ s/-/_/g;
   if (my $code = $self->can("local_$cmd")) {
     return $self->_run($cmd, $code, @argv);
   } elsif ($code = $self->can("each_$cmd")) {