-
Notifications
You must be signed in to change notification settings - Fork 64
feature: resty: impelented the --dry-run option to print out the generated configuration. #42
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
base: master
Are you sure you want to change the base?
Conversation
…rated configuration.
bin/resty
Outdated
@@ -289,6 +289,11 @@ my $lua_shared_dicts = ''; | |||
next; | |||
} | |||
|
|||
if ($arg =~ /^--dry-run$/) { |
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.
This is not really a "dry run" in the common sense and thus is confusing. I suggest using the option name --dump-nginx-conf
instead? Better be explicit for such features.
@agentzh |
bin/resty
Outdated
@@ -289,6 +289,11 @@ my $lua_shared_dicts = ''; | |||
next; | |||
} | |||
|
|||
if ($arg =~ /^--dump-nginx-conf$/) { |
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.
I think we should just use the eq
operator here since it's a constant string comparison.
bin/resty
Outdated
@@ -777,6 +779,16 @@ $loader | |||
} | |||
_EOC_ | |||
|
|||
if ($dump_nginx_conf) { | |||
print $conf; | |||
exit(0); |
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.
Better just use exit;
here since both the parentheses and 0
can be omitted.
@agentzh |
bin/resty
Outdated
@@ -894,6 +906,10 @@ Options: | |||
in the future). | |||
|
|||
-V Print version numbers and nginx configurations. | |||
|
|||
--dump-nginx-conf Print out the generated nginx configuration file only | |||
without running the Lua code. |
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.
I think we can omit "out" and "only" from this sentence, and maybe be more explicit even:
Print the generated nginx configuration file, without running nginx nor the Lua code.
No description provided.