builtin function: remove dead code

This commit is contained in:
Johannes Altmanninger
2025-09-29 21:08:56 +02:00
parent a7f0138fc7
commit 993b977c9b
8 changed files with 3 additions and 44 deletions

View File

@@ -708,10 +708,6 @@ msgstr "%ls: Erwartete numerischen Wert"
msgid "%ls: fish was not built with embedded files"
msgstr ""
#, c-format
msgid "%ls: function name required"
msgstr "%ls: Brauche Funktionsnamen"
#, c-format
msgid "%ls: given %d indexes but %d values\n"
msgstr ""

View File

@@ -706,10 +706,6 @@ msgstr "%ls: expected a numeric value"
msgid "%ls: fish was not built with embedded files"
msgstr ""
#, c-format
msgid "%ls: function name required"
msgstr ""
#, c-format
msgid "%ls: given %d indexes but %d values\n"
msgstr ""

View File

@@ -807,10 +807,6 @@ msgstr "%ls : valeur numérique attendue"
msgid "%ls: fish was not built with embedded files"
msgstr ""
#, c-format
msgid "%ls: function name required"
msgstr ""
#, c-format
msgid "%ls: given %d indexes but %d values\n"
msgstr ""

View File

@@ -702,10 +702,6 @@ msgstr "%ls: oczekiwano wartości liczbowej"
msgid "%ls: fish was not built with embedded files"
msgstr ""
#, c-format
msgid "%ls: function name required"
msgstr ""
#, c-format
msgid "%ls: given %d indexes but %d values\n"
msgstr ""

View File

@@ -707,10 +707,6 @@ msgstr "%ls: esperava valor numérico"
msgid "%ls: fish was not built with embedded files"
msgstr ""
#, c-format
msgid "%ls: function name required"
msgstr ""
#, c-format
msgid "%ls: given %d indexes but %d values\n"
msgstr ""

View File

@@ -703,10 +703,6 @@ msgstr ""
msgid "%ls: fish was not built with embedded files"
msgstr ""
#, c-format
msgid "%ls: function name required"
msgstr ""
#, c-format
msgid "%ls: given %d indexes but %d values\n"
msgstr ""

View File

@@ -700,10 +700,6 @@ msgstr "%ls: 预期数字类型值"
msgid "%ls: fish was not built with embedded files"
msgstr ""
#, c-format
msgid "%ls: function name required"
msgstr "%ls: 函数名称是必须的"
#, c-format
msgid "%ls: given %d indexes but %d values\n"
msgstr "%ls: 给定的 %d 索引但 %d 值\n"

View File

@@ -243,20 +243,7 @@ fn parse_cmd_opts(
STATUS_CMD_OK
}
fn validate_function_name(
argv: &mut [&wstr],
function_name: &mut WString,
cmd: &wstr,
streams: &mut IoStreams,
) -> c_int {
if argv.len() < 2 {
// This is currently impossible but let's be paranoid.
streams
.err
.append(wgettext_fmt!("%ls: function name required", cmd));
return STATUS_INVALID_ARGS;
}
*function_name = argv[1].to_owned();
fn validate_function_name(function_name: &wstr, cmd: &wstr, streams: &mut IoStreams) -> c_int {
if !valid_func_name(function_name) {
streams.err.append(wgettext_fmt!(
"%ls: %ls: invalid function name",
@@ -294,8 +281,8 @@ pub fn function(
let cmd = argv[0];
// A valid function name has to be the first argument.
let mut function_name = WString::new();
let mut retval = validate_function_name(argv, &mut function_name, cmd, streams);
let function_name = argv[1].to_owned();
let mut retval = validate_function_name(&function_name, cmd, streams);
if retval != STATUS_CMD_OK {
return retval;
}