WriteHelp writes the help output with translated flag descriptions
()
| 128 | |
| 129 | // WriteHelp writes the help output with translated flag descriptions |
| 130 | func (h *TranslatedHelpWriter) WriteHelp() { |
| 131 | fmt.Fprintf(h.writer, "%s\n", i18n.T("usage_header")) |
| 132 | fmt.Fprintf(h.writer, " %s %s\n\n", h.parser.Name, i18n.T("options_placeholder")) |
| 133 | |
| 134 | fmt.Fprintf(h.writer, "%s\n", i18n.T("application_options_header")) |
| 135 | h.writeAllFlags() |
| 136 | |
| 137 | fmt.Fprintf(h.writer, "\n%s\n", i18n.T("help_options_header")) |
| 138 | fmt.Fprintf(h.writer, " -h, --help %s\n", i18n.T("help_message")) |
| 139 | } |
| 140 | |
| 141 | func (h *TranslatedHelpWriter) getTranslatedDescription(flagName string) string { |
| 142 | if i18nKey, exists := flagDescriptionMap[flagName]; exists { |
no test coverage detected