Is it necessary to do multiple path of onfail to do this? file_name has no extension. And the last onfail is intended to suggest existing local files with empty or .pal extension.
l[-1]
{
rm.
ib ${file_name}
onfail
l[] {
ib ${file_name}.pal
onfail
closest_args=${rep_sug_args\ $c_arg,,1,75%,0%,1,0,100%,10%,1,",./",${rep_local_files\ ,pal}}
if !same('$closest_args','--0000e0')
error "File '"$c_arg"' does not exist! Expected one of the files (case-insensitive): "$closest_args
else
error no_closest_match_found
fi
}
}
So, basically, it’s this:
try importing file without extension
onfail
try importing file with extension
onfail
suggest files to import
Could the language be modified to allow for multiple onfail?
Also, I ended up on using 3 nested onfail.
It looks like this for rep_import_pal
try importing file without extension
onfail
try importing file with extension .pal
onfail
try importing file with extension .pal
onfail
suggest files to import
And the real code snip:
l[-1]
{
rm.
ib ${file_name}
onfail
l[] {
ib ${file_name}.pal
onfail
l[] {
ib ${file_name}.PAL
onfail
closest_args=${rep_sug_args\ $c_arg,,1,75%,0%,1,0,100%,10%,1,\",./\",{:${rep_local_files\ ,pal,PAL}}}
if !same('$closest_args','--0000e0')
error[0--1] "File '"$c_arg"' does not exist! Expected one of the files (case-insensitive): "$closest_args
else
error[0--1] no_closest_match_found
fi
}
}
}