-
Notifications
You must be signed in to change notification settings - Fork 3
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
Making refresh rate controllable from CLI #30
base: main
Are you sure you want to change the base?
Conversation
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.
Looks good.
@@ -11,6 +11,7 @@ module.exports = function() { | |||
.option('--changes-limit [value]', 'number of changes to batch') | |||
.option('--postgres-table [value]', 'name of the postgres table to replicate to') | |||
.option('-d, --daemon', 'continually replicate between CouchDB and PostgresSQL') | |||
.option('-s, --sleep', 'Sleep interval in milliseconds between runs in daemon mode (default 10 * 60 * 60 * 1000 [ms] = 10 hrs)') |
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.
👍
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.
Can we come up with a better name for this parameter? I'm thinking --sleep-interval
or --polling-interval
or something more descriptive?
Secondly, commander
allows setting defaults which would save a little code later on, eg:
.option('-s, --sleep', 'Sleep interval in milliseconds between runs in daemon mode (default 10 * 60 * 60 * 1000 [ms] = 10 hrs)') | |
.option('-s, --sleep', 'Sleep interval in milliseconds between runs in daemon mode', 10 * 60 * 60 * 1000) |
There are even more complicated options if you want to parse the variable or provide a human readable default value. More info in their documentation.
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.
Nice addition! I've left a comment inline about parameter naming and using more advanced features of commander.
Per #29