#!/usr/bin/env python '''A program to create tar files from a file or directory.''' import sys import os from anuga.utilities.system_tools import tar_file # assumed program name - refreshed from command line args Prog_Name = 'tar_file.py' # print usage info. and exit def usage(): print 'usage: %s [, ...]' % Prog_Name print 'where is the path to the tar file to create,' print ' is the path to a file or directory to include.' sys.exit(10) # get program name # does this work on Windows? Prog_Name = os.path.basename(sys.argv[0]) # check args if len(sys.argv) < 2: usage() # create the tarred/compressed file tar_file(sys.argv[2:], sys.argv[1])