You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that embed is the conventional way to add documentation to commands, it makes sense to explore ways to put all the documentation for a given command into a single file within the desc directory. In fact, where it is stored does matter, we simply have to use Reflect to look for a string that matches the name of the command.
//go:embed desc/foo.md
var fooCmdDoc string
var fooCmd := &Z.Cmd{
// ...
}
The performance hit from using Reflect is minimal for this type of operation since it is only to display help and would not affect anything else being called dynamically from the help command itself.
The use of docs should, however, be discouraged since it is used for other things like KEG and GitHub pages sites.
The text was updated successfully, but these errors were encountered:
Now that embed is the conventional way to add documentation to commands, it makes sense to explore ways to put all the documentation for a given command into a single file within the
desc
directory. In fact, where it is stored does matter, we simply have to useReflect
to look for a string that matches the name of the command.The performance hit from using
Reflect
is minimal for this type of operation since it is only to display help and would not affect anything else being called dynamically from thehelp
command itself.The use of
docs
should, however, be discouraged since it is used for other things like KEG and GitHub pages sites.The text was updated successfully, but these errors were encountered: