compiler: add vfmt() to reduce complexity
parent
bc606415c3
commit
797b35cdcb
|
@ -148,16 +148,7 @@ fn main() {
|
||||||
*/
|
*/
|
||||||
// Just fmt and exit
|
// Just fmt and exit
|
||||||
if 'fmt' in args {
|
if 'fmt' in args {
|
||||||
file := args.last()
|
vfmt(args)
|
||||||
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')
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// v get sqlite
|
// 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) {
|
fn install_v(args[]string) {
|
||||||
if args.len < 3 {
|
if args.len < 3 {
|
||||||
println('usage: v install [module] [module] [...]')
|
println('usage: v install [module] [module] [...]')
|
||||||
|
|
Loading…
Reference in New Issue