Skip to content

Commit fb8bbe4

Browse files
Added Visibility parameter
1 parent b3a840c commit fb8bbe4

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

cli/cli.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ func (c *Cli) parseGenerateArgs() {
113113
lang := generateDocsCmd.String("language", "", "Programming language: JavaScript, Java, Kotlin")
114114
replace := generateDocsCmd.Bool("replace", false, "Determines if the existing documentations are replaced")
115115
codePath := generateDocsCmd.String("codepath", "", "The codepath to match.")
116+
visibility := generateDocsCmd.String("visibility", "", "Visibility.")
116117
minimalLinesLength := generateDocsCmd.Int("minimal-lines-length", 0, "The minimal lines complexity.")
117118
endpoint := generateDocsCmd.String("endpoint", "", "The endpoint name.")
118119
failFast := generateDocsCmd.Bool("fail-fast", true, "Whether to stop on error.")
@@ -143,7 +144,7 @@ func (c *Cli) parseGenerateArgs() {
143144

144145
files := generateDocsCmd.Args()[0:]
145146

146-
if err := c.generateDocumentation(cl, lang, replace, codePath, minimalLinesLength, failFast, files); err != nil {
147+
if err := c.generateDocumentation(cl, lang, replace, codePath, visibility, minimalLinesLength, failFast, files); err != nil {
147148
c.logger.Errorf("Could not generate the documentation %v", err)
148149
}
149150
break
@@ -225,7 +226,7 @@ func (c *Cli) generateCode(cl client.Client, lang *string, replace *bool, codePa
225226
return err
226227
}
227228

228-
output, err := c.process(cl, client.ModeCode, *lang, *replace, codePath, nil, model, source)
229+
output, err := c.process(cl, client.ModeCode, *lang, *replace, codePath, nil, nil, model, source)
229230
if err != nil {
230231
if !c.isFailFast(failFast) {
231232
c.logger.Errorf("Failed to process file %s %v", file, err)
@@ -246,7 +247,7 @@ func (c *Cli) generateCode(cl client.Client, lang *string, replace *bool, codePa
246247
})
247248
}
248249

249-
func (c *Cli) generateDocumentation(cl client.Client, lang *string, replace *bool, codePath *string, minimalLinesLength *int, failFast *bool, files []string) error {
250+
func (c *Cli) generateDocumentation(cl client.Client, lang *string, replace *bool, codePath *string, visibility *string, minimalLinesLength *int, failFast *bool, files []string) error {
250251
return c.walkPath(files, func(file string) error {
251252
if lang == nil || len(*lang) == 0 {
252253
actLang, err := languageFromExtension(filepath.Ext(file))
@@ -270,7 +271,7 @@ func (c *Cli) generateDocumentation(cl client.Client, lang *string, replace *boo
270271
return err
271272
}
272273

273-
output, err := c.process(cl, client.ModeDocument, *lang, *replace, codePath, minimalLinesLength, nil, source)
274+
output, err := c.process(cl, client.ModeDocument, *lang, *replace, codePath, visibility, minimalLinesLength, nil, source)
274275
if err != nil {
275276
if !c.isFailFast(failFast) {
276277
c.logger.Errorf("Failed to process file %s %v", file, err)
@@ -315,7 +316,7 @@ func (c *Cli) fixSyntax(cl client.Client, lang *string, failFast *bool, files []
315316
return nil
316317
}
317318

318-
output, err := c.process(cl, client.ModeFixSyntax, *lang, false, nil, nil, nil, source)
319+
output, err := c.process(cl, client.ModeFixSyntax, *lang, false, nil, nil, nil, nil, source)
319320
if err != nil {
320321
if !c.isFailFast(failFast) {
321322
c.logger.Errorf("Failed to process file %s %v", file, err)
@@ -335,7 +336,7 @@ func (c *Cli) fixSyntax(cl client.Client, lang *string, failFast *bool, files []
335336
})
336337
}
337338

338-
func (c *Cli) process(cl client.Client, mode string, lang string, replace bool, codePath *string, minimalLinesLength *int, model *string, source string) (*string, error) {
339+
func (c *Cli) process(cl client.Client, mode string, lang string, replace bool, codePath *string, visibility *string, minimalLinesLength *int, model *string, source string) (*string, error) {
339340
ctx := context.Background()
340341

341342
modify := client.ModifyNone
@@ -363,6 +364,7 @@ func (c *Cli) process(cl client.Client, mode string, lang string, replace bool,
363364
Modify: &modify,
364365
CodePath: codePath,
365366
Model: model,
367+
Visibility: visibility,
366368
MinimalLinesLength: optMinimalLinesLength,
367369
},
368370
})

0 commit comments

Comments
 (0)