#! /bin/sh
#!perl -w # --*- Perl -*--
eval 'exec perl -x $0 ${1+"$@"}'
    if 0;
#------------------------------------------------------------------------------
#$Author: antanas $
#$Date: 2019-11-18 11:08:55 +0200 (Mon, 18 Nov 2019) $ 
#$Revision: 7429 $
#$URL: svn://www.crystallography.net/cod-tools/tags/v2.10/scripts/cif_parse_old_star $
#------------------------------------------------------------------------------
#*
#* Parse a CIF file using the STAR::Parser.
#*
#* USAGE:
#*    $0 input1.cif input*.cif
#**

use strict;
use warnings;
use STAR::Parser;
use COD::ShowStruct qw( showHash );
use COD::SOptions qw( getOptions );
use COD::SUsage qw( usage );
use COD::ToolsVersion;

#* OPTIONS:
#*   --help, --usage
#*                     Output a short usage message (this message) and exit.
#*   --version
#*                     Output version information and exit.
#**
@ARGV = getOptions(
    "--help,--usage"    => sub { usage; exit },
    '--version'         => sub { print 'cod-tools version ',
                                 $COD::ToolsVersion::Version, "\n";
                                 exit }
);

warn "$0:: WARNING, the current output format is considered " .
     "deprecated -- it will be changed in future releases.\n";

@ARGV = ("-") unless @ARGV;

for my $filename (@ARGV) {

    my @data = STAR::Parser->parse($filename);

    for my $dataset (@data) {
        showHash( $dataset );
    }
}
