Fix directory execution, nested tab-completion quoting, and zero-argument source evaluation#65
Merged
Merged
Conversation
- Update docs to describe .tomeignore functionality
…urce execution - Directory execution now calls `help::help` instead of returning an error string. - Fixed `help_all_in_dir` template argument parameter order for list labels. - Removed incorrect quotes around `` in bash completion to fix directory completion argument parsing. - Prefixed `set --; ` for sourced scripts in bash/zsh when executed without arguments to prevent inheritance of outer positional parameters (e.g., the script name itself). - Updated `lib_tests.rs` to accurately reflect the adjusted help outputs and the new `set --;` expectations for sourced commands.
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.
This PR addresses multiple issues regarding command execution logic, help parameter formatting, and shell argument inheritance in
tome.Changes Included:
Directory execution correctly outputs helpful listings
CommandType::Executenow evaluate to ahelp::helpstring instead of returning a generic error indicating the user executed a directory. Effectively, executing a directory is treated the same as invokingmy_cmd helpon that directory context natively.commands/help.rsforhelp_all_in_dir, which originally wrongly substituted the output templates.Tab completions successfully split nested directories
commands/init.rs, the expansion argument passed intocommand-complete ... "$tome_args"caused bash array parameters broken by spaces to be wrapped collectively into a single argument value array block. Removed quotes ($tome_args) so complete expands array params natively line-by-line enabling nested script evaluation.Restored proper Argument inheritance isolation for sourced scripts
sourceblocks if no parameters are supplied. When executingsource file.sourceon a zero-length argument base,.sourceaccidentally inherited the script context bounds (e.g.$1=script_name).set --;via string formatting directly ontoCommandType::Executepaths undertome/src/script.rswhenever targeted length maps to exactly zero on valid source scripts (Only withinbash/zsh).src/lib_tests.rsto validate positional parameters clearing viaset --;.