From be16eeef69e94ee2e1addea202dd48d750ea2fe1 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Fri, 13 Dec 2024 18:30:18 +0100 Subject: [PATCH] Make --install install without confirmation, and not exit --- README.rst | 2 +- doc_src/cmds/fish.rst | 5 ++--- src/bin/fish.rs | 17 ++--------------- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/README.rst b/README.rst index 34371f9a7..5fc9bfe9a 100644 --- a/README.rst +++ b/README.rst @@ -173,7 +173,7 @@ You can also build fish as a self-installing binary. This will include all the datafiles like the included functions or web configuration tool in the main ``fish`` binary. -On the first interactive run, and whenever it notices they are out of date, it will extract the datafiles to ~/.local/share/fish/install/ (currently, subject to change). You can do this manually by running ``fish --install`` (or ``fish --install=noconfirm`` to skip the confirmation). +On the first interactive run, and whenever it notices they are out of date, it will extract the datafiles to ~/.local/share/fish/install/ (currently, subject to change). You can do this manually by running ``fish --install``. To install fish as self-installable, just use ``cargo``, like:: diff --git a/doc_src/cmds/fish.rst b/doc_src/cmds/fish.rst index e87614fdf..22c7e17c4 100644 --- a/doc_src/cmds/fish.rst +++ b/doc_src/cmds/fish.rst @@ -40,10 +40,9 @@ The following options are available: **-i** or **--interactive** The shell is interactive. -**--install[=noconfirm]** +**--install** When built as self-installable (via cargo), this will unpack fish's datafiles and place them in ~/.local/share/fish/install/. - Using ``--install=noconfirm`` will skip the confirmation step. - Fish will also do this automatically when run interactively. + Fish will also ask to do this automatically when run interactively. **-l** or **--login** Act as if invoked as a login shell. diff --git a/src/bin/fish.rs b/src/bin/fish.rs index e97962c6f..7fbbde9bc 100644 --- a/src/bin/fish.rs +++ b/src/bin/fish.rs @@ -540,7 +540,7 @@ fn fish_parse_opt(args: &mut [WString], opts: &mut FishCmdOpts) -> ControlFlow ControlFlow opts.batch_cmds.push("__fish_print_help fish".into()), 'i' => opts.is_interactive_session = true, 'I' => { - let noconfirm = match w.woptarg { - None => false, - Some(n) if n == L!("noconfirm") => true, - _ => { - FLOGF!( - error, - "Unknown argument to --install: '%ls'", - w.woptarg.unwrap() - ); - std::process::exit(1); - } - }; - let ret = install(!noconfirm); - std::process::exit(if ret { 0 } else { 1 }); + install(false); } 'l' => opts.is_login = true, 'N' => {