Diff
Not logged in

Differences From Artifact [79fff162dc]:

To Artifact [5618bdee19]:


21
22
23
24
25
26
27

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65




66
67
68
69
70
71
72
73
74
75
76
77





78
79
80



81
82
83
84
85
86
87
88
89
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

46
47
48
49
50
51
52

53
54
55
56
57
58
59
60
61




62
63
64
65

66
67
68

69






70
71
72
73
74



75
76
77
78

79
80
81
82
83
84
85







+















+

-







-









-
-
-
-
+
+
+
+
-



-

-
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+

-







package require Tcl 8.4                               ; # Required runtime.
package require snit                                  ; # OO system.
package require vc::tools::trouble                    ; # Error reporting.
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

# # ## ### ##### ######## ############# #####################
## 

snit::type ::vc::fossil::import::cvs::option {
    # # ## ### ##### ######## #############
    ## Public API, Options.

    # --help, --help-passes, -h
    # --version
    # -p, --pass, --passes
    # --ignore-conflicting-attics
    # --project
    # -v, --verbose
    # -q, --quiet
    # --state (conversion status, ala config.cache)

    # --cache (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

    typemethod process {arguments} {
	# 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 }
		--project                   { repository add [Value arguments] }
		-v                          -
		--verbose                   { log verbose }
		-q                          -
		--quiet                     { log quiet }

		--cache       {
		    # [Value arguments]
		--state                     { state use [Value arguments] }
		default {
		    Usage $badoption$option\n$gethelp
		}
		default { Usage $badoption$option\n$gethelp }
	    }
	}

	if {[llength $arguments] > 1} Usage
	if {[llength $arguments] < 1} { Usage $nocvs }
	repository base [lindex $arguments 0]

99
100
101
102
103
104
105


106
107
108
109
110
111
112
113
114
115
116
117
118



119
120
121
122
123
124
125
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126







+
+













+
+
+







	trouble info "Usage: $argv0 $usage"
	trouble info ""
	trouble info "  Information options"
	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"
	trouble info "    -p, --passes ?START?:?END? Run only the passes START through END,"
	trouble info "                               inclusive."
	trouble info ""
	trouble info "                               Passes are specified by name."
	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
	# ...
	return
    }

    proc PrintVersion {} {
164
165
166
167
168
169
170

171
172
173
174
175
176
177
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179







+







    ## Internal methods, state validation

    proc Validate {} {
	# Prevent in-depth validation if the options were already bad.
	trouble abort?

	repository validate
	state      setup

	trouble abort?
	return
    }

    # # ## ### ##### ######## #############
    ## Configuration
187
188
189
190
191
192
193

194
195
196
197
198
199
200
201
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204







+








    namespace export option
    namespace eval option {
	namespace import ::vc::tools::trouble
	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
    }
}

# # ## ### ##### ######## ############# #####################
## Ready

package provide vc::fossil::import::cvs::option 1.0
return