mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 19:41:15 -03:00
builtin function: remove dead code
This commit is contained in:
4
po/de.po
4
po/de.po
@@ -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 ""
|
||||
|
||||
4
po/en.po
4
po/en.po
@@ -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 ""
|
||||
|
||||
4
po/fr.po
4
po/fr.po
@@ -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 ""
|
||||
|
||||
4
po/pl.po
4
po/pl.po
@@ -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 ""
|
||||
|
||||
@@ -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 ""
|
||||
|
||||
4
po/sv.po
4
po/sv.po
@@ -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 ""
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user