| 1 | package App::RepoSync::Script; | ||
| 2 | use warnings; | ||
| 3 | use strict; | ||
| 4 | use App::RepoSync::Command::Export; | ||
| 5 | use App::RepoSync::Command::Import; | ||
| 6 | use base qw( CLI::Framework ); | ||
| 7 | |||
| 8 | sub option_spec { | ||
| 9 | [ 'help|h' => 'show help' ], | ||
| 10 | # [ 'verbose|v' => 'be verbose' ], | ||
| 11 | # [ 'db=s' => 'path to SQLite database file' ], | ||
| 12 | } | ||
| 13 | |||
| 14 | sub usage_text { qq{ | ||
| 15 | $0 [--verbose|v] | ||
| 16 | |||
| 17 | OPTIONS | ||
| 18 | -h --help : show help | ||
| 19 | |||
| 20 | COMMANDS | ||
| 21 | help - show application or command-specific help | ||
| 22 | console - start a command console for the application | ||
| 23 | export - scan and export repositories | ||
| 24 | import - import repositories to current directory | ||
| 25 | } } | ||
| 26 | |||
| 27 | sub command_map { | ||
| 28 | export => 'App::RepoSync::Command::Export', | ||
| 29 | import => 'App::RepoSync::Command::Import', | ||
| 30 | sync => 'App::RepoSync::Command::Sync', | ||
| 31 | help => 'CLI::Framework::Command::Help', | ||
| 32 | list => 'CLI::Framework::Command::List', | ||
| 33 | console => 'CLI::Framework::Command::Console', | ||
| 34 | } | ||
| 35 | |||
| 36 | sub init { | ||
| 37 | my ($self, $opts,$command) = @_; | ||
| 38 | return 1; | ||
| 39 | } | ||
| 40 | |||
| 41 | 1; |