@@ -53,31 +53,42 @@ var (
5353 Level : "info" ,
5454 Format : "json" ,
5555 },
56- Runner : runner.RunnerConfig {
57- MaxWorkers : 4 ,
58- Timeout : "30s" ,
59- },
60- Parallel : struct {
61- Dsg bool
62- Ol bool
63- }{Dsg : true , Ol : true },
64- Dsg : struct {
65- Disk []string `required:"true"`
66- Delay int `default:"30"`
67- }{Disk : []string {"E:" }, Delay : 30 },
68- Ol : struct {
69- Delay int `default:"2"`
70- Patterns []struct {
71- Title string
72- Opacity byte
56+ Refresh : 10 ,
57+ Cmd : struct {
58+ Dsg struct {
59+ Parallel bool
60+ Disk []string `required:"true"`
61+ Delay int `default:"30"`
62+ }
63+ Ol struct {
64+ Parallel bool
65+ Delay int `default:"2"`
66+ Patterns []struct {
67+ Title string
68+ Opacity byte
69+ }
7370 }
74- }{Delay : 2 , Patterns : []struct {
75- Title string
76- Opacity byte
7771 }{
78- {Title : "(XY|xy)plorer" , Opacity : 200 },
79- {Title : "设置$" , Opacity : 220 },
80- }},
72+ Dsg : struct {
73+ Parallel bool
74+ Disk []string `required:"true"`
75+ Delay int `default:"30"`
76+ }{Parallel : true , Disk : []string {"E:" }, Delay : 30 },
77+ Ol : struct {
78+ Parallel bool
79+ Delay int `default:"2"`
80+ Patterns []struct {
81+ Title string
82+ Opacity byte
83+ }
84+ }{Parallel : true , Delay : 2 , Patterns : []struct {
85+ Title string
86+ Opacity byte
87+ }{
88+ {Title : "(XY|xy)plorer" , Opacity : 200 },
89+ {Title : "设置$" , Opacity : 220 },
90+ }},
91+ },
8192 }
8293 data , err := yaml .Marshal (& defaultConfig )
8394 if err != nil {
@@ -145,10 +156,10 @@ var (
145156 Aliases : []string {"pl" },
146157 Usage : "并行+后台执行任务 (配置取自wutils.yml)" ,
147158 Action : func (cCtx * cli.Context ) (err error ) {
148- if kr .Config .Parallel .Dsg {
159+ if kr .Config .Cmd .Dsg . Parallel {
149160 go kr .Dsg ()
150161 }
151- if kr .Config .Parallel .Ol {
162+ if kr .Config .Cmd .Ol . Parallel {
152163 kr .Ol ()
153164 }
154165
0 commit comments