-
Notifications
You must be signed in to change notification settings - Fork 646
Delete Files Flag for Generate Command #693
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
Conversation
| println!("Are you sure you want to delete these files? [y/N]"); | ||
| let mut input = String::new(); | ||
| std::io::stdin().read_line(&mut input)?; | ||
| if input.trim().to_lowercase() == "y" || input.trim().to_lowercase() == "yes" { |
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.
I'd like to see a --force flag or similar which skips this check, so that generate --delete-files --force can be called in scripts.
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.
I'd like to see a
--forceflag or similar which skips this check, so thatgenerate --delete-files --forcecan be called in scripts.
Added 👍
gefjon
left a comment
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.
Suggestions for phrasing in flag help messages. Code looks good; is clear to me.
Co-authored-by: Phoebe Goldman <[email protected]> Signed-off-by: John Detter <[email protected]>
Co-authored-by: Phoebe Goldman <[email protected]> Signed-off-by: John Detter <[email protected]>
Description of Changes
Please describe your change, mention any related tickets, and so on here.
--delete-filesto thespacetime generatecommand which, when supplied, shows the user which files were not generated by us and prompts them if they would like to delete the files. We also check to see if the file starts with our auto-gen tag so that we only prompt the user to delete files that were created by us. This means they can add in their own files and we won't delete them.When running with the new flag we get something like this:
If you enter y or yes to this prompt it will remove the files for you. You can add
--forceonto the end as well if you would like to execute the removal of the files without a prompt.API and ABI breaking changes
If this is an API or ABI breaking change, please apply the
corresponding GitHub label.
Expected complexity level and risk
0
How complicated do you think these changes are? Grade on a scale from 1 to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex change.
This complexity rating applies not only to the complexity apparent in the diff,
but also to its interactions with existing and future code.
If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning ways.