Index: freebsd-to-rtems.py
===================================================================
--- freebsd-to-rtems.py	(revision b9c291c14711667cbe2bb7fabd4dc983dc6bc569)
+++ freebsd-to-rtems.py	(revision a803d120b6211795d4bc6d9b60a3e0a3b64a1361)
@@ -38,19 +38,30 @@
 import getopt
 
-RTEMS_DIR = sys.argv[1]
-FreeBSD_DIR = '.'
-verbose = False
+RTEMS_DIR = "not_set"
+FreeBSD_DIR = "not_set"
+isVerbose = False
 isForward = True
+isDryRun = True
+isEarlyExit = False
 
 def usage():
-	print "Usage help here"
+  print "freebsd-to-rtems.py [args]"
+  print "  -?|-h|--help     print this and exit"
+  print "  -d|--dry-run     run program but no modifications"
+  print "  -e|--early-exit  evaluate arguments, print results, and exit"
+  print "  -R|--reverse     default FreeBSD -> RTEMS, reverse that"
+  print "  -r|--rtems       RTEMS directory"
+  print "  -f|--freebsd     FreeBSD directory"
+  print "  -v|--verbose     enable verbose output mode"
 
 # Parse the arguments
 def parseArguments():
-  global RTEMS_DIR, FreeBSD_DIR, verbose, isForward
+  global RTEMS_DIR, FreeBSD_DIR, isVerbose, isForward, isEarlyExit
   try:
-    opts, args = getopt.getopt(sys.argv[1:], "?hRr:f:v",
+    opts, args = getopt.getopt(sys.argv[1:], "?hdeRr:f:v",
                  ["help",
                   "help",
+                  "dry-run"
+                  "early-exit"
                   "reverse"
                   "rtems="
@@ -66,8 +77,12 @@
   for o, a in opts:
     if o == "-v":
-      verbose = True
+      isVerbose = True
     elif o in ("-h", "--help", "-?"):
       usage()
       sys.exit()
+    elif o in ("-d", "--dry-run"):
+      isForward = False
+    elif o in ("-e", "--early-exit"):
+      isEarlyExit = True
     elif o in ("-R", "--reverse"):
       isForward = False
@@ -82,13 +97,23 @@
 
 parseArguments()
-print "Verbose:           " + ("no", "yes")[verbose]
+print "Verbose:           " + ("no", "yes")[isVerbose]
+print "Dry Run:           " + ("no", "yes")[isDryRun]
 print "RTEMS Directory:   " + RTEMS_DIR
 print "FreeBSD Directory: " + FreeBSD_DIR
 print "Direction:         " + ("reverse", "forward")[isForward]
 
-# test for existence of RTEMS and FreeBSD directories
-if os.path.isdir( RTEMS_DIR ) != True:
-    print "RTEMS Directory (" + RTEMS_DIR + ") does not exist"
-    sys.exit(2)
+# Check directory argument was set and exist
+def wasDirectorySet(desc, path):
+    if path == "not_set":
+        print desc + " Directory was not specified on command line"
+        sys.exit(2)
+
+    if os.path.isdir( path ) != True:
+        print desc + " Directory (" + path + ") does not exist"
+        sys.exit(2)
+
+# Were RTEMS and FreeBSD directories specified
+wasDirectorySet( "RTEMS", RTEMS_DIR )
+wasDirectorySet( "FreeBSD", FreeBSD_DIR )
  
 if os.path.isdir( FreeBSD_DIR ) != True:
@@ -96,4 +121,12 @@
     sys.exit(2)
  
+if FreeBSD_DIR == RTEMS_DIR:
+    print "FreeBSD and RTEMS Directories are the same"
+    sys.exit(2)
+
+if isEarlyExit == True:
+    print "Early exit at user request"
+    sys.exit(0)
+ 
 # Prefix added to FreeBSD files as they are copied into the RTEMS
 # build tree.
@@ -110,4 +143,8 @@
 def installEmptyFile(src):
 	dst = RTEMS_DIR + '/' + PREFIX + '/' + src.replace('rtems/', '')
+	if isVerbose == True:
+		print "Install empty - " + dst
+	if isDryRun == True:
+		return
 	try:
 		os.makedirs(os.path.dirname(dst))
@@ -136,4 +173,8 @@
 	dst = RTEMS_DIR + '/' + PREFIX + '/' + org # + org.replace('rtems/', '')
 	dst = mapContribPath(dst)
+	if isVerbose == True:
+		print "Install Header - " + src + " => " + dst
+	if isDryRun == True:
+		return
 	try:
 		os.makedirs(os.path.dirname(dst))
@@ -151,4 +192,8 @@
 	dst = RTEMS_DIR + '/' + PREFIX + '/' + org
 	dst = mapContribPath(dst)
+	if isVerbose == True:
+		print "Install Source - " + src + " => " + dst
+	if isDryRun == True:
+		return
 	try:
 		os.makedirs(os.path.dirname(dst))
@@ -167,4 +212,8 @@
 	src = mapContribPath(src)
 	dst = FreeBSD_DIR + '/' + org
+	if isVerbose == True:
+		print "Revert Header - " + src + " => " + dst
+	if isDryRun == True:
+		return
 	try:
 		os.makedirs(os.path.dirname(dst))
@@ -182,4 +231,8 @@
 	src = mapContribPath(src)
 	dst = FreeBSD_DIR + '/' + org
+	if isVerbose == True:
+		print "Revert Source - " + src + " => " + dst
+	if isDryRun == True:
+		return
 	try:
 		os.makedirs(os.path.dirname(dst))
@@ -195,4 +248,8 @@
 
 def deleteOutputDirectory():
+	if isVerbose == True:
+		print "Delete Directory - " + RTEMS_DIR
+	if isDryRun == True:
+		return
 	try:
 		shutil.rmtree(RTEMS_DIR)
@@ -228,4 +285,8 @@
 
 	def createMakefile(self):
+		if isVerbose == True:
+			print "Create Makefile"
+		if isDryRun == True:
+			return
 		data = 'include config.inc\n' \
 			'\n' \
