Do not write short description for commands in ini header
Fixes #94, again.
diff --git a/ini_private.go b/ini_private.go
index fb9c4ce..2e72b87 100644
--- a/ini_private.go
+++ b/ini_private.go
@@ -58,14 +58,14 @@
return option.field.Name
}
-func writeGroupIni(group *Group, namespace string, writer io.Writer, options IniOptions) {
+func writeGroupIni(cmd *Command, group *Group, namespace string, writer io.Writer, options IniOptions) {
var sname string
if len(namespace) != 0 {
sname = namespace
}
- if len(group.ShortDescription) != 0 {
+ if cmd.Group != group && len(group.ShortDescription) != 0 {
if len(sname) != 0 {
sname += "."
}
@@ -160,7 +160,7 @@
func writeCommandIni(command *Command, namespace string, writer io.Writer, options IniOptions) {
command.eachGroup(func(group *Group) {
- writeGroupIni(group, namespace, writer, options)
+ writeGroupIni(command, group, namespace, writer, options)
})
for _, c := range command.commands {
diff --git a/ini_test.go b/ini_test.go
index de2212d..e2b5cdc 100644
--- a/ini_test.go
+++ b/ini_test.go
@@ -90,7 +90,7 @@
; This is a subsubgroup option
Opt =
-[command.A command]
+[command]
; Use for extra verbosity
; ExtraVerbose =
@@ -144,7 +144,7 @@
; This is a subsubgroup option
; Opt =
-[command.A command]
+[command]
; Use for extra verbosity
; ExtraVerbose =
@@ -196,7 +196,7 @@
; This is a subsubgroup option
; Opt =
-[command.A command]
+[command]
; Use for extra verbosity
; ExtraVerbose =