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

Custom Template Path in --doc_opt doesn't work with an absolute path #497

Open
chaitanyamalik opened this issue Oct 19, 2022 · 0 comments
Open

Comments

@chaitanyamalik
Copy link

Hey there,

I am trying to run protoc-gen-doc with a custom template with the following command: (this is a demo command)

"C:\User\protoc.exe" -I ./ "C:\User\path\to\proto\hello.proto" --plugin=protoc-gen-doc="protoc-gen-doc.exe" --doc_out="C:\User\output" --doc_opt="C:\User\custom.tmpl","out.csv":"google/*"

This returns an error stating: error parsing regexp: invalid escape sequence: \U
pointing to C:\User (I assume).

When I do change the template path to relative in --doc_opt, it throws no such error. Indicating the problem lies in doc_opt.

But why is it taking this as a regex pattern in the first place?

I carried a bit of research and in the documentation, the format for doc-opt was stated as:

The parameter (--doc_opt) must be of the format <TYPE|TEMPLATE_FILE>,<OUTPUT_FILE>[,default|source_relative]:<EXCLUDE_PATTERN>,<EXCLUDE_PATTERN>*. The file will be written to the directory specified with the --doc_out argument to protoc.

Notice the colon(":"), I think that's what is causing the compiler to parse the path as a regex in the first place. (from C:\User).
I even added quotes after that, to seperate the arguments but still didn't work.

Is there a way to solve this?

Thanks in advance!

S1artie added a commit to GEBIT/protoc-gen-doc that referenced this issue Feb 1, 2023
S1artie added a commit to GEBIT/protoc-gen-doc that referenced this issue Feb 3, 2023
S1artie added a commit to GEBIT/protoc-gen-doc that referenced this issue Feb 3, 2023
S1artie added a commit to GEBIT/protoc-gen-doc that referenced this issue Feb 10, 2023
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

1 participant