From 7818249fecfc52871df7118348484da3bd6c5b30 Mon Sep 17 00:00:00 2001 From: Michael Norrish Date: Fri, 5 Jan 2024 10:23:39 +1100 Subject: [PATCH] Allow build's clean options to be given in any mix of letter-cases --- tools/buildhelp.txt | 3 +++ tools/buildutils.sml | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/buildhelp.txt b/tools/buildhelp.txt index 027fbd15a3..ef2c3dd381 100644 --- a/tools/buildhelp.txt +++ b/tools/buildhelp.txt @@ -21,4 +21,7 @@ OR build [--nograph|--graph] help builds the help system only +The clean* variations can be given in whatever mix of letter-cases +desired (i.e., "cleanall" and "Cleanall" work as well as "cleanAll"). + Options: diff --git a/tools/buildutils.sml b/tools/buildutils.sml index f1735f5639..3fcd805076 100644 --- a/tools/buildutils.sml +++ b/tools/buildutils.sml @@ -317,10 +317,12 @@ fun get_cline () = let errFn = cline_die } (CommandLine.arguments()) val option_record = apply_updates opts buildcline.initial val _ = if #help option_record then exit_with_help() else () + fun lcnorm_mem s list = + List.exists (fn s' => CharVector.map Char.toLower s' = s) list val _ = - if mem "cleanAll" rest then raise DoClean "cleanAll" - else if mem "clean" rest then raise DoClean "clean" - else if mem "cleanForReloc" rest then raise DoClean "cleanForReloc" + if lcnorm_mem "cleanall" rest then raise DoClean "cleanAll" + else if lcnorm_mem "clean" rest then raise DoClean "clean" + else if lcnorm_mem "cleanforreloc" rest then raise DoClean "cleanForReloc" else () val seqspec = case #seqname option_record of