mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
Only suggest subcommands if not a .roc path
This commit is contained in:
parent
3930d117f4
commit
b9981ece1e
1 changed files with 11 additions and 8 deletions
|
@ -578,7 +578,8 @@ pub fn build(
|
|||
));
|
||||
// Add some additional hints if run as `roc [FILENAME]`.
|
||||
if matches.subcommand().is_none() {
|
||||
if let Some(possible_typo) = path.to_str() {
|
||||
match path.to_str() {
|
||||
Some(possible_typo) if !possible_typo.ends_with(".roc") => {
|
||||
if let Some((nearest_command, _)) =
|
||||
nearest_match(possible_typo, subcommands)
|
||||
{
|
||||
|
@ -588,6 +589,8 @@ pub fn build(
|
|||
));
|
||||
}
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
error_lines.push("You can run `roc help` to see the list of available subcommands and for more information on how to provide a .roc file.".to_string());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue