mirror of
https://github.com/nushell/nushell.git
synced 2025-08-13 16:57:24 +02:00
Make config default if broken (#482)
* Make config default if broken * Make config default if broken
This commit is contained in:
@ -79,7 +79,7 @@ fn from_csv(
|
||||
|
||||
let noheaders = call.has_flag("noheaders");
|
||||
let separator: Option<Value> = call.get_flag(engine_state, stack, "separator")?;
|
||||
let config = stack.get_config()?;
|
||||
let config = stack.get_config().unwrap_or_default();
|
||||
|
||||
let sep = match separator {
|
||||
Some(Value::String { val: s, span }) => {
|
||||
|
@ -45,7 +45,7 @@ impl Command for FromEml {
|
||||
let head = call.head;
|
||||
let preview_body: Option<Spanned<i64>> =
|
||||
call.get_flag(engine_state, stack, "preview-body")?;
|
||||
let config = stack.get_config()?;
|
||||
let config = stack.get_config().unwrap_or_default();
|
||||
from_eml(input, preview_body, head, &config)
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ impl Command for FromIcs {
|
||||
input: PipelineData,
|
||||
) -> Result<nu_protocol::PipelineData, ShellError> {
|
||||
let head = call.head;
|
||||
let config = stack.get_config()?;
|
||||
let config = stack.get_config().unwrap_or_default();
|
||||
from_ics(input, head, &config)
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ b=2' | from ini",
|
||||
input: PipelineData,
|
||||
) -> Result<nu_protocol::PipelineData, ShellError> {
|
||||
let head = call.head;
|
||||
let config = stack.get_config()?;
|
||||
let config = stack.get_config().unwrap_or_default();
|
||||
from_ini(input, head, &config)
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ impl Command for FromJson {
|
||||
input: PipelineData,
|
||||
) -> Result<nu_protocol::PipelineData, ShellError> {
|
||||
let span = call.head;
|
||||
let config = stack.get_config()?;
|
||||
let config = stack.get_config().unwrap_or_default();
|
||||
let mut string_input = input.collect_string("", &config);
|
||||
string_input.push('\n');
|
||||
|
||||
|
@ -267,7 +267,7 @@ fn from_ssv(
|
||||
call: &Call,
|
||||
input: PipelineData,
|
||||
) -> Result<PipelineData, ShellError> {
|
||||
let config = stack.get_config()?;
|
||||
let config = stack.get_config().unwrap_or_default();
|
||||
let name = call.head;
|
||||
|
||||
let noheaders = call.has_flag("noheaders");
|
||||
|
@ -73,7 +73,7 @@ b = [1, 2]' | from toml",
|
||||
input: PipelineData,
|
||||
) -> Result<nu_protocol::PipelineData, ShellError> {
|
||||
let span = call.head;
|
||||
let config = stack.get_config()?;
|
||||
let config = stack.get_config().unwrap_or_default();
|
||||
let mut string_input = input.collect_string("", &config);
|
||||
string_input.push('\n');
|
||||
Ok(convert_string_to_value(string_input, span)?.into_pipeline_data())
|
||||
|
@ -33,7 +33,7 @@ impl Command for FromTsv {
|
||||
call: &Call,
|
||||
input: PipelineData,
|
||||
) -> Result<nu_protocol::PipelineData, ShellError> {
|
||||
let config = stack.get_config()?;
|
||||
let config = stack.get_config().unwrap_or_default();
|
||||
from_tsv(call, input, &config)
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ impl Command for FromUrl {
|
||||
input: PipelineData,
|
||||
) -> Result<nu_protocol::PipelineData, ShellError> {
|
||||
let head = call.head;
|
||||
let config = stack.get_config()?;
|
||||
let config = stack.get_config().unwrap_or_default();
|
||||
from_url(input, head, &config)
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ impl Command for FromVcf {
|
||||
input: PipelineData,
|
||||
) -> Result<nu_protocol::PipelineData, ShellError> {
|
||||
let head = call.head;
|
||||
let config = stack.get_config()?;
|
||||
let config = stack.get_config().unwrap_or_default();
|
||||
from_vcf(input, head, &config)
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ impl Command for FromXml {
|
||||
input: PipelineData,
|
||||
) -> Result<nu_protocol::PipelineData, ShellError> {
|
||||
let head = call.head;
|
||||
let config = stack.get_config()?;
|
||||
let config = stack.get_config().unwrap_or_default();
|
||||
from_xml(input, head, &config)
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ impl Command for FromYaml {
|
||||
input: PipelineData,
|
||||
) -> Result<nu_protocol::PipelineData, ShellError> {
|
||||
let head = call.head;
|
||||
let config = stack.get_config()?;
|
||||
let config = stack.get_config().unwrap_or_default();
|
||||
from_yaml(input, head, &config)
|
||||
}
|
||||
}
|
||||
@ -100,7 +100,7 @@ impl Command for FromYml {
|
||||
input: PipelineData,
|
||||
) -> Result<nu_protocol::PipelineData, ShellError> {
|
||||
let head = call.head;
|
||||
let config = stack.get_config()?;
|
||||
let config = stack.get_config().unwrap_or_default();
|
||||
from_yaml(input, head, &config)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user