diff --git a/pkg/util/gendoc/gendoc.go b/pkg/util/gendoc/gendoc.go index 5da211e2b..8897bf1e5 100644 --- a/pkg/util/gendoc/gendoc.go +++ b/pkg/util/gendoc/gendoc.go @@ -28,6 +28,18 @@ const ( type Options struct { // Parameters for man generation. By default use (1) section and `FrostFS` source. ManHeader *doc.GenManHeader + // TypeFlag is the flag to use for type, without leading `--`. + // Do not use unless really necessary. + // Default: `type`. + TypeFlag string + // DepthFlag is the flag to use for depth, without leading `--`. + // Do not use unless really necessary. + // Default: `depth`. + DepthFlag string + // ExtensionFlag is the flag to use for extension, without leading `--`. + // Do not use unless really necessary. + // Default: `extension`. + ExtensionFlag string } func (o *Options) fillDefaults() { @@ -39,6 +51,15 @@ func (o *Options) fillDefaults() { Date: &now, } } + if o.TypeFlag == "" { + o.TypeFlag = gendocTypeFlag + } + if o.DepthFlag == "" { + o.DepthFlag = depthFlag + } + if o.ExtensionFlag == "" { + o.ExtensionFlag = extensionFlag + } } // Command returns command which generates user documentation for the argument. @@ -93,9 +114,9 @@ In this case there is a number of helper functions which can be used: } ff := gendocCmd.Flags() - ff.String(gendocTypeFlag, gendocMarkdown, "Type for the documentation ('md' or 'man')") - ff.Int(depthFlag, 1, "If template is specified, unify all commands starting from depth in a single file. Default: 1.") - ff.String(extensionFlag, "", "If the template is specified, string to append to the output file names") + ff.String(opts.TypeFlag, gendocMarkdown, "Type for the documentation ('md' or 'man')") + ff.Int(opts.DepthFlag, 1, "If template is specified, unify all commands starting from depth in a single file. Default: 1.") + ff.String(opts.ExtensionFlag, "", "If the template is specified, string to append to the output file names") return gendocCmd }