@@ -10,13 +10,13 @@ import (
10
10
)
11
11
12
12
type CommandPull struct {
13
- Locale string `name:"locale" short:"l" help:"Specify the locale to pull. If not specified, the default locale will be used."`
14
- Raw bool `name:"raw" help:"It pulls raw data without converting it from HTML to Markdown."`
15
- SaveArticle bool `name:"save-article" short:"a" help:"It pulls and saves the article in addition to the translation."`
16
- WithoutSectionDir bool `name:"without -section-dir" help:"It doesn't save in a directory named after the section ID."`
17
- ArticleIDs []int `arg:"" help:"Specify the article IDs to pull." type:"int"`
18
- client zendesk.Client `kong:"-"`
19
- converter converter.Converter `kong:"-"`
13
+ Locale string `name:"locale" short:"l" help:"Specify the locale to pull. If not specified, the default locale will be used."`
14
+ Raw bool `name:"raw" help:"It pulls raw data without converting it from HTML to Markdown."`
15
+ SaveArticle bool `name:"save-article" short:"a" help:"It pulls and saves the article in addition to the translation."`
16
+ WithSectionDir bool `name:"with -section-dir" short:"S" help:"A .md file will be created in the section ID directory ."`
17
+ ArticleIDs []int `arg:"" help:"Specify the article IDs to pull." type:"int"`
18
+ client zendesk.Client `kong:"-"`
19
+ converter converter.Converter `kong:"-"`
20
20
}
21
21
22
22
func (c * CommandPull ) AfterApply (g * Global ) error {
@@ -40,10 +40,8 @@ func (c *CommandPull) Run(g *Global) error {
40
40
return err
41
41
}
42
42
43
- var saveDirPath string
44
- if c .WithoutSectionDir {
45
- saveDirPath = g .Config .ContentsDir
46
- } else {
43
+ saveDirPath := g .Config .ContentsDir
44
+ if c .WithSectionDir {
47
45
saveDirPath = filepath .Join (g .Config .ContentsDir , strconv .Itoa (a .SectionID ))
48
46
}
49
47
0 commit comments