Skip non-executable files, add .source suffix convention (#53)#63
Merged
Conversation
toumorokoshi
force-pushed
the
53-skip-non-executable-files
branch
2 times, most recently
from
April 7, 2026 05:33
e6dc8d7 to
bd176b9
Compare
- Only files with the executable bit set are recognized as tome commands - Files with a .source suffix are treated as sourceable scripts (no exec bit needed) - The .source suffix replaces the # SOURCE header comment - Dot-prefixed directories continue to be ignored - Non-executable files (READMEs, data files, libraries) are now excluded from help output and tab completion automatically Breaking changes: - Scripts that were previously recognized but lack the executable bit will no longer appear as commands - The # SOURCE header is no longer recognized; use the .source suffix instead Closes #53
toumorokoshi
force-pushed
the
53-skip-non-executable-files
branch
from
April 7, 2026 05:40
bd176b9 to
40bb7fc
Compare
toumorokoshi
marked this pull request as ready for review
April 8, 2026 05:03
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.
Related: #53
Summary
Implements the design proposed in #53 (comment). Only files with the executable bit set are now recognized as tome commands, and a new
.sourcesuffix convention replaces the# SOURCEheader for sourceable scripts.This makes it possible to include READMEs, data files, and library scripts in a tome directory without them appearing in help output or tab completion.
Changes
script.rs:is_tome_scriptnow takes a&Pathand checks: (1) no dot-prefix, (2).sourcesuffix files are always valid, (3) otherwise the file must have the executable bit. Addedresolve_source_pathfor transparent.sourcefile lookup. Removed# SOURCEheader parsing — source detection is now purely filename-based.directory.rs: Passes full path tois_tome_script. Strips.sourcesuffix from command names sofoo.sourceappears as commandfoo.finder.rs: Usesresolve_source_pathto find bothfooandfoo.sourcewhen resolving commands.complete.rs: Uses newis_tome_script(&path)for filtering, strips.sourcesuffix from completion candidates, usesresolve_source_pathfor file lookup.source_example→source_example.source,source_example_fish→source_example_fish.source,use-arg→use-arg.source,navigate_directory→navigate_directory.source. Addednon_executable_filetest fixture. Removed# SOURCEheaders from all files.# SOURCEheader tests with.sourcesuffix tests.authoring-scripts.mdanddirectories.mdto document the executable-bit requirement and.sourcesuffix convention.Breaking Changes
.sourcesuffix)# SOURCEheader comment is no longer recognized; use the.sourcefile suffix instead