1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v: offer a suggestion for misspelled commands like v held

This commit is contained in:
Delyan Angelov 2022-07-16 14:58:26 +03:00
parent b01df8ed0a
commit bd4e9f6225
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -141,7 +141,15 @@ fn main() {
if prefs.is_help { if prefs.is_help {
invoke_help_and_exit(args) invoke_help_and_exit(args)
} }
eprintln('v $command: unknown command')
other_commands := ['run', 'crun', 'build', 'build-module', 'help', 'version', 'new', 'init',
'install', 'list', 'outdated', 'remove', 'search', 'show', 'update', 'upgrade', 'vlib-docs',
'interpret', 'translate']
mut all_commands := []string{}
all_commands << external_tools
all_commands << other_commands
all_commands.sort()
eprintln(util.new_suggestion(command, all_commands).say('v: unknown command `$command`'))
eprintln('Run ${term.highlight_command('v help')} for usage.') eprintln('Run ${term.highlight_command('v help')} for usage.')
exit(1) exit(1)
} }