source: trunk/misc/tools/tar_file/tar_file.py @ 8523

Last change on this file since 8523 was 8427, checked in by davies, 12 years ago

Adding the trapezoidal channel validation test, and editing the ANUGA manual

File size: 752 bytes
Line 
1#!/usr/bin/env python
2
3'''A program to create tar files from a file or directory.'''
4
5import sys
6import os
7from anuga.utilities.system_tools import tar_file
8
9# assumed program name - refreshed from command line args
10Prog_Name = 'tar_file.py'
11
12# print usage info. and exit
13def usage():
14    print 'usage: %s <tarfile> <file1> [<file2>, ...]' % Prog_Name
15    print 'where <tarfile> is the path to the tar file to create,'
16    print '      <file?>   is the path to a file or  directory to include.'
17    sys.exit(10)
18
19# get program name
20# does this work on Windows?
21Prog_Name = os.path.basename(sys.argv[0])
22
23# check args
24if len(sys.argv) < 2:
25    usage()
26
27# create the tarred/compressed file
28tar_file(sys.argv[2:], sys.argv[1])
Note: See TracBrowser for help on using the repository browser.