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

Add flag alias feature to rename old flag smoothly #65

Open
GoogleCodeExporter opened this issue Mar 13, 2015 · 2 comments
Open

Add flag alias feature to rename old flag smoothly #65

GoogleCodeExporter opened this issue Mar 13, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

For a long term project, there exist some misnamed flags, such as missing 
currect prefix, or module name changed. if we changed the name, the 
code/running system will be broken.

Consider introduce a alias mechanism to resolve this problem.

// Modified flag with new correct name
DEFINE_int32(xfs_master_port, 8000, "some bool value");

// Compatible old name for xfs_master_port
DEFINE_int32_alias(master_port, xfs_master_port);

Run:
$ ./gflags_test --xfs_master_port=2 --help
  Flags from thirdparty/gflags/gflags_test.cpp:
    --master_port (compatible old name of 'xfs_master_port')
      type: int32 default: 8000 currently: 2
    --xfs_master_port (some bool value) type: int32
      default: 8000 currently: 2

I've implemented this feature, see the attach.

Original issue reported on code.google.com by chen3feng on 28 Jan 2013 at 1:22

Attachments:

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

1 participant