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

Remove google.apputils/gflags usage in favor of argparse. #53

Merged
merged 1 commit into from
Sep 12, 2015

Conversation

cherba
Copy link
Contributor

@cherba cherba commented Sep 10, 2015

This PR converts apitools.gen.gen/gen_client.py to use python standard argparse for command line argument parsing. Note that now type of generation argument must occur last on the command line.

proto_parser.set_defaults(func=GenerateProto)

args = parser.parse_args(argv[1:])
args.func(args)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably want to get a return value here, and then return either that or 0 (since we might fall off the end of a function and return None in places).

then we want to sys.exit(main()) below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@craigcitro
Copy link
Contributor

wahoo! this is super awesome. just one small nit with return values and we should be good to go.

This PR converts apitools.gen.gen/gen_client.py to use python standard argparse for command line argument parsing. Note that now type of generation argument must occur last on the command line.
@craigcitro
Copy link
Contributor

w00t!

craigcitro added a commit that referenced this pull request Sep 12, 2015
Remove google.apputils/gflags usage in favor of argparse.
@craigcitro craigcitro merged commit 8cc9153 into google:master Sep 12, 2015
@cherba cherba deleted the gen_client_argparse branch September 13, 2015 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants