Skip to content

Commit 8ab4961

Browse files
committed
Adds verification before removing a line
1 parent 3af5890 commit 8ab4961

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

docs/command/atlas-api-collectionLevelMetrics-getCollStatsLatencyNamespaceHostMeasurements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ atlas api collectionLevelMetrics getCollStatsLatencyNamespaceHostMeasurements
1616

1717
This command is autogenerated and corresponds 1:1 with the Atlas API endpoint https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Collection-Level-Metrics/operation/getCollStatsLatencyNamespaceHostMeasurements.
1818

19-
For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-collectionLevelMetrics-getCollStatsLatencyNamespaceHostMeasurements/
2019
For more information and examples, see the referenced API documentation linked above.
2120

2221
Syntax

docs/command/atlas-api-collectionLevelMetrics-unpinNamespaces.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ atlas api collectionLevelMetrics unpinNamespaces
1616

1717
This command is autogenerated and corresponds 1:1 with the Atlas API endpoint https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Collection-Level-Metrics/operation/unpinNamespaces.
1818

19-
For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-collectionLevelMetrics-unpinNamespaces/
2019
For more information and examples, see the referenced API documentation linked above.
2120

2221
Syntax

tools/docs/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ func updateAPICommandDescription(cmd *cobra.Command) {
7676
func updateLeafDescriptions(cmd *cobra.Command) {
7777
if len(cmd.Commands()) == 0 {
7878
lines := strings.Split(cmd.Long, "\n")
79-
// Remove the last line which will always be "For more information and examples, see: <AtlasCLI docs url>"
80-
if len(lines) > 1 {
79+
// Replace last line if it contains the extected text: "For more information and examples, see: <AtlasCLI docs url>"
80+
if strings.HasPrefix(lines[len(lines)-1], "For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/current/command/") {
8181
lines = lines[:len(lines)-1]
82+
newLine := "For more information and examples, see the referenced API documentation linked above."
83+
lines = append(lines, newLine)
8284
}
8385

84-
newLine := "For more information and examples, see the referenced API documentation linked above."
85-
lines = append(lines, newLine)
8686
cmd.Long = strings.Join(lines, "\n")
8787
}
8888

0 commit comments

Comments
 (0)