#!/usr/sbin/perl

#**************************************************************************
#*                                                                        *
#*            Copyright (c) 1996 Silicon Graphics, Inc.                   *
#*                      All Rights Reserved                               *
#*                                                                        *
#*         THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI             *
#*                                                                        *
#* The copyright notice above does not evidence any actual of intended    *
#* publication of such source code, and is an unpublished work by Silicon *
#* Graphics, Inc. This material contains CONFIDENTIAL INFORMATION that is *
#* the property of Silicon Graphics, Inc. Any use, duplication or         *
#* disclosure not specifically authorized by Silicon Graphics is strictly *
#* prohibited.                                                            *
#*                                                                        *
#* RESTRICTED RIGHTS LEGEND:                                              *
#*                                                                        *
#* Use, duplication or disclosure by the Government is subject to         *
#* restrictions as set forth in subdivision (c)(1)(ii) of the Rights in   *
#* Technical Data and Computer Software clause at DFARS 52.227-7013,      *
#* and/or in similar or successor clauses in the FAR, DOD or NASA FAR     *
#* Supplement. Unpublished - rights reserved under the Copyright Laws of  *
#* the United States. Contractor is SILICON GRAPHICS, INC., 2011 N.       *
#* Shoreline Blvd., Mountain View, CA 94039-7311                          *
#**************************************************************************

# add_tree
#
# Add a tree from the command line

# Include appropriate scripts
require "DEMO_includes.pl";

# Record action in error log
&Print_Error("$ERROR_INFO","Adding a Tree From Command Line","$STATUS_MINOR");

&Print_Usage if (! @ARGV);

if ( &Safe_Tree_Name("$ARGV[0]") && &Safe_Tree_Path_Name("$ARGV[1]") ) {
		&Add_Tree("$ARGV[0]", "$ARGV[1]", &Generate_File_Name, 1);
} else {
		&Print_Error("$ERROR_INFO","Could Not Add Tree From Command Line","$STATUS_MINOR");
		print "ERROR: Tree \'$ARGV[0]\' could not be installed.\n";
}

sub Print_Usage {
	print "USAGE: add_tree treename treepath.\n";
	print "       eg. add_tree MyDemos /usr/people/you/Demo_Dir\n";
	exit 1;
}
