Repository navigation
Add --ignore option to sh-to-mod sub-command - #746
Merged
Merged
Conversation
Let sh-to-mod withdraw some kinds of environment change made by the evaluated shell script, like the --ignore option of the source-sh modulefile command does. Both now share the same argument parsing. When set before the sub-command name, the option and its value are moved right after this name. When set after the shell argument, they are left in place as they are then arguments for the script. Fixes envmodules#532 Assisted-by: Claude:claude-fable-5-2 Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
ml filters out the command line switches to find the sub-command name among its arguments, but then withdrew the first argument instead of this name to build the sub-command argument list. With a switch set before the name, like in "ml --tag=foo load bar", the switch was lost and the sub-command name was passed as an argument to itself. Withdraw the argument that has been recognized as the sub-command name wherever it stands. Assisted-by: Claude:claude-fable-5-2 Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
xdelaruelle
force-pushed
the
issue532
branch
from
November 20, 2026 15:34
4c74d1d to
9f4fbaa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the
--ignoreoption to thesh-to-modsub-command to withdraw some kinds of environment change made by the evaluated shell script, like the--ignoreoption of thesource-shmodulefile command does. Both now share the same argument parsing and accept the same shell elements (envvar,alias,function,chdir,completeandumask).--ignoreand its value are moved right after this name. When set after the shell argument, they are left in place as they are then arguments for the script.--ignoreraises an Unsupported option error on the other sub-commands.A second commit fixes the
mlcommand when a command line switch is set before the sub-command name.mlwithdrew its first argument instead of the argument recognized as the sub-command name, so withml --tag=foo load barthe switch was lost and the sub-command name was passed as an argument to itself.Fixes #532