mirror of
https://github.com/storytold/cadcraft.git
synced 2026-11-10 12:30:16 -06:00
Plot: an unknown extension needs a real format selector (review on #2585)
device None and a null or unknown output no longer bypass the refusal and write a PDF under the odd name; only a recognised output or a device that resolves does. Test: plot_path_extension_picks_the_format_like_export.
This commit is contained in:
@@ -300,8 +300,8 @@ pub(crate) fn plot_options(s: &Session, p: &Value, cmd: &str) -> Result<Value> {
|
||||
// refuse it, as EXPORT does, unless `output` or a device says what to write.
|
||||
if cmd == "plot"
|
||||
&& by_path.is_none()
|
||||
&& p.get("output").is_none()
|
||||
&& !given.is_some_and(|n| !n.is_empty())
|
||||
&& !p.get("output").and_then(Value::as_str).is_some_and(|o| PlotOutput::parse(o).is_some())
|
||||
&& !(dev.is_some() && given.is_some_and(|n| !n.is_empty()))
|
||||
&& let Some(path) = str_param(p, "path")
|
||||
{
|
||||
return Err(bad(
|
||||
|
||||
Reference in New Issue
Block a user