From be8bda9654c6fbf7d331288c6c25becee5f6bc7f Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sun, 12 Apr 2015 17:10:22 +0300 Subject: [PATCH] Rename create to add --- MANIFEST | 2 +- lib/Gruntmaster/App/Command/{Create.pm => Add.pm} | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) rename lib/Gruntmaster/App/Command/{Create.pm => Add.pm} (92%) diff --git a/MANIFEST b/MANIFEST index e5a238d..0d3b2f2 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2,7 +2,7 @@ Changes db.sql gm lib/Gruntmaster/App.pm -lib/Gruntmaster/App/Command/Create.pm +lib/Gruntmaster/App/Command/Add.pm lib/Gruntmaster/App/Command/Get.pm lib/Gruntmaster/App/Command/List.pm lib/Gruntmaster/App/Command/Rerun.pm diff --git a/lib/Gruntmaster/App/Command/Create.pm b/lib/Gruntmaster/App/Command/Add.pm similarity index 92% rename from lib/Gruntmaster/App/Command/Create.pm rename to lib/Gruntmaster/App/Command/Add.pm index c0d5dfe..cc30301 100644 --- a/lib/Gruntmaster/App/Command/Create.pm +++ b/lib/Gruntmaster/App/Command/Add.pm @@ -1,4 +1,4 @@ -package Gruntmaster::App::Command::Create; +package Gruntmaster::App::Command::Add; use 5.014000; use warnings; @@ -21,18 +21,18 @@ use constant LEVEL_VALUES => { hard => 1000, }; -sub usage_desc { '%c [-cp] create id' } +sub usage_desc { '%c [-cp] add id' } my %TABLE = ( - contest => \&create_contest, - problem => \&create_problem, + contest => \&add_contest, + problem => \&add_problem, ); sub validate_args { my ($self, $opt, $args) = @_; my @args = @$args; $self->usage_error('No table selected') unless $self->app->table; - $self->usage_error('Don\'t know how to create this object type') unless $TABLE{$self->app->object}; + $self->usage_error('Don\'t know how to add this object type') unless $TABLE{$self->app->object}; $self->usage_error('Wrong number of arguments') if @args != 1; } @@ -42,7 +42,7 @@ sub execute { $TABLE{$self->app->object}->($self, $id); } -sub create_contest { +sub add_contest { my ($self, $id) = @_; my $name = prompt 'Contest name'; @@ -53,7 +53,7 @@ sub create_contest { db->insert(contests => {id => $id, name => $name, owner => $owner, start => $start, stop => $stop}); } -sub create_problem { +sub add_problem { my ($self, $id) = @_; my $db = $self->app->db; -- 2.39.2