Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feature request) Include a flag for determining what scripts to include #53

Open
zph opened this issue Mar 2, 2024 · 2 comments
Open

Comments

@zph
Copy link
Contributor

zph commented Mar 2, 2024

Use case:

  • When including data files or non executables in the project
  • I want them to not show up in the auto-completion nor in the bulk help text

Feature:

  • A flag (and env var value) to exclude files that are not executable per filesystem permissions
  • This flag would be passed during function instantiation in tome's shell init configuration

ie:

# Default and current behavior
eval "$(tome init my-commands --include=all ~/my-scripts bash)"

# New extension
eval "$(tome init my-commands --include=executables ~/my-scripts bash)"

@toumorokoshi Is this something you'd accept as a patch under the design conditions of "does not break default backwards compatibility"?

@zph
Copy link
Contributor Author

zph commented Apr 1, 2024

Ok, I've been thinking about this and I prototyped a simpler solution that those implicit behaviors as follows:

  1. Use a .tomeignore file in the root directory to control whether files show up in help and in tab completions
  2. Syntax is the .gitignore syntax and I used a rust gitignore parser/checker library.

I think it's a more elegant approach that solves the following usability issues:

  1. Can replace current usage of .tomeignore as a file in a folder to ignore that one folder
  2. Enables users to use a familiar file syntax to determine what to ignore
  3. Does not rely on implicit behaviors (ignore files with leading dot) or only show files that are executable

If you also like this approach and want it contributed back, let me know 👍

@toumorokoshi
Copy link
Owner

toumorokoshi commented Apr 1, 2024

Hey! thanks for the suggestion.

If there's a strong need for custom ignoring of files - I think a gitignore-style file with glob matches makes sense. And happy to accept a PR!

FYI all scripts and files with a leading dot are ignored today. Does that not work for your use case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants