Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Commit f261556

Browse files
author
Mathias Lindholm
committed
Show default string values in docs
1 parent daa90d5 commit f261556

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

docs/convert.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ speechly convert [flags]
1111
### Flags
1212

1313
* `--help` `-h` _(bool)_ - help for convert
14-
* `--language` `-l` _(string)_ - Language of input
14+
* `--language` `-l` _(string)_ - Language of input (default 'en-US')
1515

1616
### Examples
1717

docs/create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Creates a new application in the current project and a config file in the curren
1313
### Flags
1414

1515
* `--help` `-h` _(bool)_ - help for create
16-
* `--language` `-l` _(string)_ - Application language. See docs for available options https://docs.speechly.com/basics/models
16+
* `--language` `-l` _(string)_ - Application language. See docs for available options https://docs.speechly.com/basics/models (default 'en-US')
1717
* `--name` `-n` _(string)_ - Application name. Can be given as the sole positional argument.
1818
* `--output-dir` `-o` _(string)_ - Output directory for the config file.
1919

docs/generate.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,15 @@ func flags(c *cobra.Command) string {
118118
if c.HasFlags() {
119119
b.WriteString("### Flags\n\n")
120120
c.Flags().VisitAll(func(f *flag.Flag) {
121-
vt := f.Value.Type()
121+
valType := f.Value.Type()
122+
defValue := ""
123+
if valType == "string" && f.DefValue != "" {
124+
defValue = " (default '" + f.DefValue + "')"
125+
}
122126
if f.Shorthand == "" {
123-
b.WriteString("* `--" + f.Name + "` _(" + vt + ")_ - " + f.Usage + "\n")
127+
b.WriteString("* `--" + f.Name + "` _(" + valType + ")_ - " + f.Usage + defValue + "\n")
124128
} else {
125-
b.WriteString("* `--" + f.Name + "` `-" + f.Shorthand + "` _(" + vt + ")_ - " + f.Usage + "\n")
129+
b.WriteString("* `--" + f.Name + "` `-" + f.Shorthand + "` _(" + valType + ")_ - " + f.Usage + defValue + "\n")
126130
}
127131
})
128132
}

docs/projects_add.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ speechly projects add [flags]
1212

1313
* `--apikey` _(string)_ - API token, created in Speechly Dashboard. Can also be given as the sole positional argument.
1414
* `--help` `-h` _(bool)_ - help for add
15-
* `--host` _(string)_ - API address
15+
* `--host` _(string)_ - API address (default 'api.speechly.com')
1616
* `--name` _(string)_ - An unique name for the project. If not given the project name configured in Speechly Dashboard will be used.
1717
* `--skip-online-validation` _(bool)_ - Skips validating the API token against the host.
1818

0 commit comments

Comments
 (0)