Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/c2f_option.tcl part of check-in [2929a438ef] - Extended option processing, added handling of verbosity/quietness. by aku on 2007-10-04 04:32:49. [view]

To:

File tools/cvs2fossil/lib/c2f_option.tcl part of check-in [eb656de7d9] - Added the basic parts of the state manager and integrated it with option processor and pass manager. by aku on 2007-10-05 05:33:14. [view]

@@ -24,8 +24,9 @@
 package require vc::tools::log                        ; # User feedback.
 package require vc::fossil::import::cvs::pass         ; # Pass management
 package require vc::fossil::import::cvs::pass::collar ; # Pass I.
 package require vc::fossil::import::cvs::repository   ; # Repository management
+package require vc::fossil::import::cvs::state        ; # State storage
 
 # # ## ### ##### ######## ############# #####################
 ##
 
@@ -39,18 +40,17 @@
     # --ignore-conflicting-attics
     # --project
     # -v, --verbose
     # -q, --quiet
-
-    # --cache (conversion status, ala config.cache)
+    # --state (conversion status, ala config.cache)
+
     # -o, --output
     # --dry-run
     # --trunk-only
     # --force-branch RE
     # --force-tag RE
     # --symbol-transform RE:XX
     # --exclude
-    # -p, --passes
 
     # # ## ### ##### ######## #############
     ## Public API, Methods
 
@@ -58,29 +58,25 @@
 	# Syntax of arguments: ?option ?value?...? /path/to/cvs/repository
 
 	while {[IsOption arguments -> option]} {
 	    switch -exact -- $option {
-		-h            -
-		--help        { PrintHelp    ; exit 0 }
-		--help-passes { pass help    ; exit 0 }
-		--version     { PrintVersion ; exit 0 }
-
+		-h                          -
+		--help                      { PrintHelp    ; exit 0 }
+		--help-passes               { pass help    ; exit 0 }
+		--version                   { PrintVersion ; exit 0 }
 		-p                          -
 		--pass                      -
 		--passes                    { pass select [Value arguments] }
-
 		--ignore-conflicting-attics { collar ignore_conflicting_attics }
-
-		--project { repository add [Value arguments] }
-		-v        -
-		--verbose { log verbose }
-		-q        -
-		--quiet   { log quiet }
-
-		--cache       {
-		    # [Value arguments]
-		}
-		default { Usage $badoption$option\n$gethelp }
+		--project                   { repository add [Value arguments] }
+		-v                          -
+		--verbose                   { log verbose }
+		-q                          -
+		--quiet                     { log quiet }
+		--state                     { state use [Value arguments] }
+		default {
+		    Usage $badoption$option\n$gethelp
+		}
 	    }
 	}
 
 	if {[llength $arguments] > 1} Usage
@@ -102,8 +98,10 @@
 	trouble info ""
 	trouble info "    -h, --help    Print this message and exit with success"
 	trouble info "    --help-passes Print list of passes and exit with success"
 	trouble info "    --version     Print version number of $argv0"
+	trouble info "    -v, --verbose Increase application's verbosity"
+	trouble info "    -q, --quiet   Decrease application's verbosity"
 	trouble info ""
 	trouble info "  Conversion control options"
 	trouble info ""
 	trouble info "    -p, --pass PASS            Run only the specified conversion pass"
@@ -114,8 +112,11 @@
 	trouble info ""
 	trouble info "    --ignore-conflicting-attics"
 	trouble info "                               Prevent abort when conflicting archives"
 	trouble info "                               were found in both regular and Attic."
+	trouble info ""
+	trouble info "    --state PATH               Save state to the specified file, and"
+	trouble info "                               load state of previous runs from it too."
 	trouble info ""
 
 	# --project, --cache
 	# ...
@@ -167,8 +168,9 @@
 	# Prevent in-depth validation if the options were already bad.
 	trouble abort?
 
 	repository validate
+	state      setup
 
 	trouble abort?
 	return
     }
@@ -190,8 +192,9 @@
 	namespace import ::vc::tools::log
 	namespace import ::vc::fossil::import::cvs::pass
 	namespace import ::vc::fossil::import::cvs::pass::collar
 	namespace import ::vc::fossil::import::cvs::repository
+	namespace import ::vc::fossil::import::cvs::state
     }
 }
 
 # # ## ### ##### ######## ############# #####################