Skip to content

Pass include_paths via CLI? #70

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

Closed
bdmayes opened this issue Mar 31, 2025 · 5 comments · Fixed by #71
Closed

Pass include_paths via CLI? #70

bdmayes opened this issue Mar 31, 2025 · 5 comments · Fixed by #71

Comments

@bdmayes
Copy link

bdmayes commented Mar 31, 2025

Sorry, I'm not familiar with rust, but I have been trying to go through the code and as far as I can tell, there appears to be no way to pass the include_paths config option via a command line argument. Is that true? Thus far all I can see is that it's possible to set this value via the toml file:

https://github.com/coder3101/protols?tab=readme-ov-file#%EF%B8%8F-configuration

Is it possible to do something like protols --include_paths=/foo? Am I just missing something obvious?

@coder3101
Copy link
Owner

Correct, we don't have a way to pass include paths from command line. In terms of cli --version is the only option.

I plan to add more CLI argument support with clap in next release.

@bdmayes
Copy link
Author

bdmayes commented Mar 31, 2025

Thanks for the quick reply! I look forward to that new release. I am currently using vscode and more specifically, the following extension: https://github.com/ianandhum/vscode-protobuf-support

Unfortunately, it marks all import statements as errors (red squiggles) in the .proto files. I can adjust args passed in the vscode config file (settings.json). Thus, having the ability to pass include_paths through as command line args to protols would be very valuable. 🙂

@coder3101
Copy link
Owner

coder3101 commented Mar 31, 2025

Although, I have created a PR to address this issue. I wonder why you can't just create a protols.toml file in the root of workspace (git) with include_paths? If you don't want to commit this file in version control you can add an ignore for it in .git/info/exclude this is local ignore file within your git repository. The include paths in toml could be outside the working directory (absolute) or relative to workspace as well.

@bdmayes
Copy link
Author

bdmayes commented Mar 31, 2025

Great question. I tried putting the toml file in my repo as well as a sibling of my protols executable. Neither option resolved the "errors." I haven't looked further to understand why. For now I am ignoring the "errors" as long as the rest of my build process works, and the protobuf package successfully gets deployed.

@coder3101
Copy link
Owner

A new release 0.11.5 with this has been published on crates.io

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

Successfully merging a pull request may close this issue.

2 participants