-
Notifications
You must be signed in to change notification settings - Fork 986
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
Add optional arg to serve
for extra paths to watch for changes
#2745
Conversation
serve
for extra paths to watch for changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some nits
|
||
/// Extra path to watch for changes, relative to the project root. | ||
#[clap(long)] | ||
extra_watch_path: Vec<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be extra_watch_paths
since it's a vec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a vec, but the user would multiple paths by repeating the argument.
zola serve --extra_watch_path="a" --extra_watch_path="b"
So I think the singular makes the most sense. There's some precedent for this, e.g.
curl --header "Content-Type: application/json" --header "Authorization: Bearer token" https://api.example.com
grep --regexp="pattern1" --regexp="pattern2" file.txt
Happy to change it if you prefer though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine, I thought it was --extra_watch_paths=something,something_else
with clap being smart enough to split on the ,
|
||
/// Extra path to watch for changes, relative to the project root. | ||
#[clap(long)] | ||
extra_watch_path: Vec<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine, I thought it was --extra_watch_paths=something,something_else
with clap being smart enough to split on the ,
Thanks! |
This PR implements a feature discussed in #2741.
Sanity check:
Code changes
Are you doing the PR on the
next
branch?Have you created/updated the relevant documentation page(s)?
There does seem to be some existing documentation related to the args for
serve
, but it is not comprehensive, and I suspect this isn't important enough to include there.