compiler: add vfmt() to reduce complexity

pull/1923/head
Vitor Oliveira 2019-09-10 15:49:56 -07:00 committed by Alexander Medvednikov
parent bc606415c3
commit 797b35cdcb
1 changed files with 14 additions and 10 deletions

View File

@ -148,16 +148,7 @@ fn main() {
*/
// Just fmt and exit
if 'fmt' in args {
file := args.last()
if !os.file_exists(file) {
println('"$file" does not exist')
exit(1)
}
if !file.ends_with('.v') {
println('v fmt can only be used on .v files')
exit(1)
}
println('vfmt is temporarily disabled')
vfmt(args)
return
}
// v get sqlite
@ -913,6 +904,19 @@ fn update_v() {
}
}
fn vfmt(args[]string) {
file := args.last()
if !os.file_exists(file) {
println('"$file" does not exist')
exit(1)
}
if !file.ends_with('.v') {
println('v fmt can only be used on .v files')
exit(1)
}
println('vfmt is temporarily disabled')
}
fn install_v(args[]string) {
if args.len < 3 {
println('usage: v install [module] [module] [...]')