#! /bin/sh
#!perl -w # --*- Perl -*--
eval 'exec perl -x $0 ${1+"$@"}'
    if 0;
#------------------------------------------------------------------------------
#$Author: antanas $
#$Date: 2017-05-24 20:10:55 +0300 (Tr, 24 geg. 2017) $ 
#$Revision: 5322 $
#$URL: svn://www.crystallography.net/cod-tools/tags/v2.3/scripts/ssg_symop_canonical $
#------------------------------------------------------------------------------
#*
#* Canonicalise superspace group symmetry operator strings.
#*
#* USAGE: $0 < input.symop
#* USAGE: $0 input.symop
#* USAGE: $0 input1.symop input*.symop
#**
use strict;
use warnings;
use COD::SOptions qw( getOptions );
use COD::SUsage qw( usage );
use COD::Spacegroups::Symop::SSGParse qw( symop_string_canonical_form );
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 }
);

while(<>) {
    next if /^#/;
    next if /^\s*$/;
    chomp;
    print "\n# $_\n";
    print symop_string_canonical_form( $_ ), "\n";
}
