-
Notifications
You must be signed in to change notification settings - Fork 583
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
util-app: roll up flag parsing errors
Problem When parsing flags, we escape on the first parsing failure. This behavior results in poor user experience and odd side effects in certain scenarios. For the user, if they have multiple flag errors, they are forced to iterate and fix the errors 1-by-1. Without knowing that there are other parse failures to fix - this is a slow and time consuming feedback loop. In instances where an app references flag values as part of the lifecycle (i.e. as part of cleaning up/closing the app), a parse failure can result in remaining flags not being parsed, which cascades when we fail when flags are referenced, but not yet parsed, resulting in unclean shutdown of the app. Solution We will ensure that all flags get parsed consistently and that we roll-up errors as a single error result. We will also print a help message as part of a parse error, so that users are given the reason their flags were failed to be parsed, along with the expected usage for defined/available flags. Result A more streamlined experience for users attempting to remedy mistaken flag definitions and better behavior when flags are referenced during various phases of the application lifecycle. JIRA Issues: CSL-11231 Differential Revision: https://phabricator.twitter.biz/D729700
- Loading branch information
Showing
3 changed files
with
31 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters