diff options
-rwxr-xr-x | mat | 33 |
1 files changed, 13 insertions, 20 deletions
@@ -514,36 +514,29 @@ read_recipe_db; if ($ARGV[0]) { if ( $ARGV[0] eq "help") { print "Command failed!\n" unless (cmd_help >= 0); - } - if ( $ARGV[0] eq "addrecipe") { + } elsif ( $ARGV[0] eq "addrecipe") { print "Command failed!\n" unless (cmd_addrecipe() >= 0); - } - if ( $ARGV[0] eq "editrecipe") { + } elsif ( $ARGV[0] eq "editrecipe") { print "Command failed!\n" unless (cmd_editrecipe($ARGV[1]) >= 0); - } - if ( $ARGV[0] eq "showrecipe") { + } elsif ( $ARGV[0] eq "showrecipe") { print "Command failed!\n" unless (cmd_showrecipe($ARGV[1]) >= 0); - } - if ( $ARGV[0] eq "movemeal") { + } elsif ( $ARGV[0] eq "movemeal") { print "Command failed!\n" unless (cmd_movemeal($ARGV[1], $ARGV[2]) >= 0); - } - if ( $ARGV[0] eq "setmeal") { + } elsif ( $ARGV[0] eq "setmeal") { print "Command failed!\n" unless (cmd_setmeal($ARGV[1], $ARGV[2]) >= 0); - } - if ( $ARGV[0] eq "setstate") { + } elsif ( $ARGV[0] eq "setstate") { print "Command failed!\n" unless (cmd_setstate($ARGV[1], $ARGV[2]) >= 0); - } - if ( $ARGV[0] eq "randmeal") { + } elsif ( $ARGV[0] eq "randmeal") { print "Command failed!\n" unless (cmd_randmeal($ARGV[1]) >= 0); - } - if ( $ARGV[0] eq "showplan") { + } elsif ( $ARGV[0] eq "showplan") { print "Command failed!\n" unless (cmd_showplan($ARGV[1]) >= 0); - } - if ( $ARGV[0] eq "postpone") { + } elsif ( $ARGV[0] eq "postpone") { print "Command failed!\n" unless (cmd_postpone($ARGV[1]) >= 0); - } - if ( $ARGV[0] eq "shoppinglist") { + } elsif ( $ARGV[0] eq "shoppinglist") { print "Command failed!\n" unless (cmd_shoppinglist($ARGV[1]) >= 0); + } else { + print "Unknown command $ARGV[0]\n"; + exit 1; } } else { cmd_showplan; |