@@ -24,12 +24,17 @@ type Request struct {
24
24
25
25
// NewRequest returns a request initialized with given arguments
26
26
// An non-nil error will be returned if the provided option values are invalid
27
+ << << << < HEAD
27
28
func NewRequest (ctx context.Context ,
28
29
path []string , opts OptMap ,
29
30
args []string ,
30
31
file files.Directory ,
31
32
root * Command ,
32
33
) (* Request , error ) {
34
+ == == == =
35
+ func NewRequest (ctx context .Context , path []string , opts OptMap , args []string ,
36
+ file files.Directory , root * Command ) (* Request , error ) {
37
+ >> >> >> > 90843374 f694708a997c8e6e4d15142610c50cbf
33
38
if opts == nil {
34
39
opts = make (OptMap )
35
40
}
@@ -39,7 +44,11 @@ func NewRequest(ctx context.Context,
39
44
return nil , err
40
45
}
41
46
47
+ << << << < HEAD
42
48
err = checkAndConvertOptions (root , opts , path )
49
+ == == == =
50
+ err = convertOptions (root , opts , path )
51
+ >> >> >> > 90843374 f694708a997c8e6e4d15142610c50cbf
43
52
req := & Request {
44
53
Path : path ,
45
54
Options : opts ,
@@ -100,7 +109,11 @@ func (req *Request) SetOption(name string, value interface{}) {
100
109
return
101
110
}
102
111
112
+ << << << < HEAD
103
113
func checkAndConvertOptions (root * Command , opts OptMap , path []string ) error {
114
+ == == == =
115
+ func convertOptions (root * Command , opts OptMap , path []string ) error {
116
+ >> >> >> > 90843374 f694708a997c8e6e4d15142610c50cbf
104
117
optDefs , err := root.GetOptions (path )
105
118
if err != nil {
106
119
return err
0 commit comments