#!/usr/bin/env perl

# Given a DO ID, report whether or not the corresponding DO is exportable.
#
# Usage:
#
#     is-exportable.pl {DB_NAME} {DO_ID}
 
use strict;
use warnings;

use PS::MOPS::ExportLib;
use PS::MOPS::DC::Instance;

our $g_DBNAME; # Name of database to be processed.
our $g_DO_ID; # Derived Object ID
my $input; # User input.

if($ARGV[0]){
    $g_DBNAME=$ARGV[0];
}
else {
    print "Usage:\n";
    exit;
}

if($ARGV[1]){
    $g_DO_ID=$ARGV[1];
}
else {
    print "ERROR: Require DO ID.\n";
    exit;
}

our $inst=PS::MOPS::DC::Instance->new(DBNAME=>$g_DBNAME);

my $result=is_exportable($inst,$g_DO_ID);
print "result=$result\n";
