mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-29 14:23:09 +00:00
commandline: Borrow libdata later
builtin_print_help will end up borrowing it as mutable. Fixes #10342
This commit is contained in:
parent
ff6fd699fe
commit
031dbb33b1
2 changed files with 6 additions and 2 deletions
|
@ -198,8 +198,6 @@ pub fn commandline(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr])
|
||||||
let mut range = 0..0;
|
let mut range = 0..0;
|
||||||
let mut override_buffer = None;
|
let mut override_buffer = None;
|
||||||
|
|
||||||
let ld = parser.libdata();
|
|
||||||
|
|
||||||
const short_options: &wstr = L!(":abijpctfxorhI:CBELSsP");
|
const short_options: &wstr = L!(":abijpctfxorhI:CBELSsP");
|
||||||
let long_options: &[woption] = &[
|
let long_options: &[woption] = &[
|
||||||
wopt(L!("append"), woption_argument_t::no_argument, 'a'),
|
wopt(L!("append"), woption_argument_t::no_argument, 'a'),
|
||||||
|
@ -292,6 +290,8 @@ pub fn commandline(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr])
|
||||||
|
|
||||||
let positional_args = w.argv.len() - w.woptind;
|
let positional_args = w.argv.len() - w.woptind;
|
||||||
|
|
||||||
|
let ld = parser.libdata();
|
||||||
|
|
||||||
if function_mode {
|
if function_mode {
|
||||||
// Check for invalid switch combinations.
|
// Check for invalid switch combinations.
|
||||||
if buffer_part.is_some()
|
if buffer_part.is_some()
|
||||||
|
|
|
@ -17,3 +17,7 @@ or echo Invalid $status
|
||||||
commandline --input 'echo $$' --is-valid
|
commandline --input 'echo $$' --is-valid
|
||||||
or echo Invalid $status
|
or echo Invalid $status
|
||||||
# CHECK: Invalid 1
|
# CHECK: Invalid 1
|
||||||
|
|
||||||
|
commandline --help >/dev/null
|
||||||
|
echo Invalid $status
|
||||||
|
# CHECK: 1
|
||||||
|
|
Loading…
Reference in a new issue