mirror of
https://github.com/rclone/rclone.git
synced 2024-12-23 12:13:48 +08:00
0df7466d2b
This change addresses two issues with commands that re-used flags from common packages: 1) cobra.Command definitions did not include the command specific prefix in doc strings. 2) Command specific flag prefixes were added after generating command doc strings.
16 lines
326 B
Go
16 lines
326 B
Go
package http
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestHelpPrefixTemplate(t *testing.T) {
|
|
// This test assumes template variables are placed correctly.
|
|
const testPrefix = "template-help-test"
|
|
helpMessage := TemplateHelp(testPrefix)
|
|
if !strings.Contains(helpMessage, testPrefix) {
|
|
t.Fatal("flag prefix not found")
|
|
}
|
|
}
|