Clean up clean command - #948
Conversation
urbanjost
left a comment
There was a problem hiding this comment.
Looks good. An optional suggestion might be to stop users from specifying both --all and --skip on the command line. in fpm_command_line.f90 in the case for 'clean' maybe a check like:
if (all(specified(['skip','all '])))then
call fpm_stop(6,'mutually exclusive options --all and --skip were specified on the clean subcommand')
endifand for consistency in the same section where the optional ampersand was added for a more consistent treatment on the CLEAN_CALL=LGET('all') line; should probably also add it in other places like just above that one the HELP_CLEAN, VERSION_TEXT) line as well. Maybe we should run all code through something like wfindent/findent, emacs, vim, fprettify, ... I dislike some
of the choices of findent, fprettify, ... line "end if" instead of "endif" and so on, but consistency would probably make things easier to read. Good with it as-is, so consider these comments for consideration. Using a standard format processor is probably a long-term consideration; I think it would be good to consider making --skip and --all mutually exclusive but users are unlikely to do it. Current behavior is that everything is removed if both are specified with no warning or error thrown.
|
Thanks @urbanjost, I will add the mutual exclusion feature in another PR. I'm also a big fan of automated code formatting. It has been proposed here #825 but it was dropped. Thanks everyone for the reviews. |
fpm_clean_settings.How to test
Verify that the functionality has not changed using the following commands:
fpm run -- cleanfpm run -- clean --skipfpm run -- clean --all