Add some magic to transform raw "active" and "inactive" to status=$1
authorGreg Sabino Mullane <greg@endpoint.com>
Sun, 15 Jun 2014 11:53:08 +0000 (07:53 -0400)
committerGreg Sabino Mullane <greg@endpoint.com>
Sun, 15 Jun 2014 11:53:08 +0000 (07:53 -0400)
bucardo

diff --git a/bucardo b/bucardo
index c9c8e722238a7e0c7c915b03dc066aac45647be9..6927d67420c40f469c26af4a073093cda8a9ca69 100755 (executable)
--- a/bucardo
+++ b/bucardo
@@ -8747,6 +8747,15 @@ sub process_simple_args {
         }
     }
 
+    ## Automatic morphing magic
+    if (exists $item{status} and ! exists $dbcol{status}) {
+        for my $stat (qw/ active inactive /) {
+            if (grep { $_ eq $stat } @{ $xyargs->{extraargs} }) {
+                $dbcol{status} = $stat;
+            }
+        }
+    }
+
     ## Build the lists of columns and placeholders for the SQL statement
     my ($cols,$phs,$vals) = ('','',{});
     for my $col (sort keys %dbcol) {