Closed texastoland closed 5 months ago
Closing in favor of #185 for now. I attempted this way because it's more minimal than the directory approach. But 3 specific bugs in export use
make it brittle and leave an unresolved issue re-exporting main
commands (see FIXME
above).
This PR enables the following:
gm
exportMostly mechanical changes. Module contents were left unindented to improve diff readability. 1 innocuous change took me hours and needs documented for future maintenance:
My first attempt was to
export use
each module:But
export use
partially hides nested modules (nushell/nushell#12066) so:But
export use
shadows modules instead of merging them (TODO: report bug) so:But
export use
doesn't permit multiple module chain members (nushell/nushell#12057) so:But
export use
still hides submodules so:None of these workarounds would be necessary using 1 file per submodule because they could be passed to
export module
above instead ofexport use
. A less brittle alternative would be to create a directory for each category module, 1 script for each leaf module, and 1mod.nu
to wrap it in thegm
namespace. For example: