diff --git a/src/App/Program.fs b/src/App/Program.fs index e8fb0560..3ffad782 100644 --- a/src/App/Program.fs +++ b/src/App/Program.fs @@ -754,9 +754,26 @@ let main argv = { LogDebugPartitions = List.ofSeq mission.LogDebugPartitions LogTracePartitions = List.ofSeq mission.LogTracePartitions } + let looksLikeFlagValue (s: string) = + match s.ToLowerInvariant() with + | "true" | "false" -> true + | _ -> + let (isNumeric, _) = System.Double.TryParse(s) + isNumeric + match Seq.tryFind (allMissions.ContainsKey >> not) mission.Missions with | Some e -> (LogError "Unknown mission: %s" e + + if looksLikeFlagValue e then + LogError + "Note: '%s' looks like a value for a command-line flag rather than a mission name. You may have passed an argument to a flag that doesn't accept one (e.g. --catchup-skip-known-results-for-testing=false instead of --catchup-skip-known-results-for-testing)." + e + elif e.StartsWith("-") then + LogError + "Note: '%s' looks like a command-line option rather than a mission name. You may have a typo in the option name, or used an option not supported by the 'mission' verb." + e + LogError "Available missions:" Map.iter (fun k _ -> LogError " %s" k) allMissions 1)