From 4e76850cd0633c7254ce315ea8828d926d026e76 Mon Sep 17 00:00:00 2001 From: Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com> Date: Thu, 19 Oct 2023 18:41:54 +0200 Subject: [PATCH] Remove `to xml --pretty` (#10668) followup to - https://github.com/nushell/nushell/pull/10660 --- crates/nu-command/src/formats/to/xml.rs | 36 ++----------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/crates/nu-command/src/formats/to/xml.rs b/crates/nu-command/src/formats/to/xml.rs index 6290a618e660..59fca82f4e66 100644 --- a/crates/nu-command/src/formats/to/xml.rs +++ b/crates/nu-command/src/formats/to/xml.rs @@ -4,8 +4,8 @@ use nu_engine::CallExt; use nu_protocol::ast::Call; use nu_protocol::engine::{Command, EngineState, Stack}; use nu_protocol::{ - report_error_new, Category, Example, IntoPipelineData, PipelineData, Record, ShellError, - Signature, Span, Spanned, SyntaxShape, Type, Value, + Category, Example, IntoPipelineData, PipelineData, Record, ShellError, Signature, Span, + Spanned, SyntaxShape, Type, Value, }; use quick_xml::events::{BytesEnd, BytesStart, BytesText, Event}; use std::io::Cursor; @@ -22,12 +22,6 @@ impl Command for ToXml { fn signature(&self) -> Signature { Signature::build("to xml") .input_output_types(vec![(Type::Record(vec![]), Type::String)]) - .named( - "pretty", - SyntaxShape::Int, - "DEPRECATED option, will be removed in 0.87. Please use `--indent {int}` instead.", - Some('p'), - ) .named( "indent", SyntaxShape::Int, @@ -86,33 +80,7 @@ Additionally any field which is: empty record, empty list or null, can be omitte input: PipelineData, ) -> Result { let head = call.head; - if call.has_flag("pretty") { - report_error_new( - engine_state, - &ShellError::GenericError( - "Deprecated option".into(), - "`to xml --pretty {int}` is deprecated and will be removed in 0.87.".into(), - Some(call.head), - Some("Please use `--indent {int}` instead.".into()), - vec![], - ), - ); - } - let pretty: Option> = call.get_flag(engine_state, stack, "pretty")?; let indent: Option> = call.get_flag(engine_state, stack, "indent")?; - let indent = match (pretty, indent) { - (Some(pretty), Some(indent)) => { - return Err(ShellError::IncompatibleParameters { - left_message: "Cannot pass --pretty".into(), - left_span: pretty.span, - right_message: "and --indent".into(), - right_span: indent.span, - }) - } - (Some(pretty), None) => Some(pretty), - (None, Some(indent)) => Some(indent), - (None, None) => None, - }; let input = input.try_expand_range()?; to_xml(input, head, indent) }