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

command line flags: dashes and underscores synonyms #7405

Open
shlomi-noach opened this issue Jan 28, 2021 · 2 comments
Open

command line flags: dashes and underscores synonyms #7405

shlomi-noach opened this issue Jan 28, 2021 · 2 comments

Comments

@shlomi-noach
Copy link
Contributor

As pointed by @deepthi here we have a mixture of dash and underscore in our command line flags. Examples:

tabletPath = flag.String("tablet-path", "", "tablet alias")
tabletConfig = flag.String("tablet_config", "", "YAML file config for tablet")

flag.BoolVar(&currentConfig.EnforceStrictTransTables, "enforce_strict_trans_tables", defaultConfig.EnforceStrictTransTables, "If true, vttablet requires MySQL to run with STRICT_TRANS_TABLES or STRICT_ALL_TABLES on. It is recommended to not turn this flag off. Otherwise MySQL may alter your supplied values before saving them to the database.")
flag.BoolVar(&enableConsolidator, "enable-consolidator", true, "This option enables the query consolidator.")
flag.BoolVar(&enableConsolidatorReplicas, "enable-consolidator-replicas", false, "This option enables the query consolidator only on replicas.")
flag.BoolVar(&currentConfig.CacheResultFields, "enable-query-plan-field-caching", defaultConfig.CacheResultFields, "This option fetches & caches fields (columns) when storing query plans")

and so on...

This is confusing. We should align on a standard. But we also obviously want to maintain backwards compatibility. I found this on a related discussion and am suggesting we can go down that path: we'll standardize on underscored, and make dash-based flags synonyms. Thus, -enable-lag-throtler and -enable_lag_throttler will be synonyms.

Sample PR to follow to illustrate.

@shlomi-noach
Copy link
Contributor Author

#7406 as an example

@shlomi-noach shlomi-noach self-assigned this Jan 28, 2021
@shlomi-noach
Copy link
Contributor Author

on vttablet-side, this is fixed by #7406

I'll proceed to check other apps, namely vtctld

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants