Advertisement
swaggboi

elsif-diff

Sep 11th, 2020
1,480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.90 KB | None | 0 0
  1. # OLD:
  2. # if we need to run a command that doesn't require fully parsing the config file, do it now (and exit)
  3. if (!defined($cmd) or ((!$cmd) && ('0' ne $cmd))) {
  4.     show_usage();
  5. }
  6. elsif ($cmd eq 'help') {
  7.     show_help();
  8. }
  9. elsif ($cmd eq 'version') {
  10.     show_version();
  11. }
  12. elsif ($cmd eq 'version-only') {
  13.     show_version_only();
  14. }
  15. elsif ($cmd eq 'check-config-version') {
  16.     check_config_version();
  17. }
  18. elsif ($cmd eq 'upgrade-config-file') {
  19.     upgrade_config_file();
  20. }
  21.  
  22. # NEW:
  23. # if we need to run a command that doesn't require fully parsing the config file, do it now (and exit)
  24. for ($cmd) {
  25.     show_usage()           if !defined($_) or ((!$_) && ('0' ne $_));
  26.     show_help()            if /help/;
  27.     show_version()         if /version/;
  28.     show_version_only()    if /version-only/;
  29.     check_config_version() if /check-config-version/;
  30.     upgrade_config_file()  if /upgrade-config-file/;
  31. }
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement