From ed8c78c0ea1e19cbf0e8898f7b060a450598df56 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Wed, 29 Sep 2021 03:08:10 -0700 Subject: [PATCH] Update docs, completions for funcsave Remove long opt for -q, funcsave does not have so many options that it's any help. --- doc_src/cmds/funcsave.rst | 8 ++++---- share/completions/funcsave.fish | 6 ++++-- share/functions/funcsave.fish | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/doc_src/cmds/funcsave.rst b/doc_src/cmds/funcsave.rst index 4cd56efc3..ca5035567 100644 --- a/doc_src/cmds/funcsave.rst +++ b/doc_src/cmds/funcsave.rst @@ -9,14 +9,14 @@ Synopsis :: funcsave FUNCTION_NAME - funcsave [(-d | --directory) where/to/save ] FUNCTION_NAME + funcsave [-q] [(-d | --directory) DIR ] FUNCTION_NAME Description ----------- -``funcsave`` saves a function to a file in the fish configuration directory. This function will be :ref:`automatically loaded ` by current and future fish sessions. This can be useful if you have interactively created a new function and wish to save it for later use. +``funcsave`` saves a function to a file in the fish configuration directory. This function will be :ref:`automatically loaded ` by current and future fish sessions. This can be useful to commit functions created interactively for permanent use. -Note that because fish loads functions on-demand, saved functions will not function as :ref:`event handlers ` until they are run or sourced otherwise. To activate an event handler for every new shell, add the function to your :ref:`configuration file ` instead of using ``funcsave``. +Because fish loads functions on-demand, saved functions cannot serve as :ref:`event handlers ` until they are run or otherwise sourced. To activate an event handler for every new shell, add the function to the :ref:`configuration file ` instead of using ``funcsave``. -This is typically used together with :ref:`funced `, which will open the function in your editor and load it in the current seession afterwards. +This is often used after :ref:`funced `, which opens the function in ``$EDITOR`` or ``$VISUAL`` and loads it into the current session afterwards. diff --git a/share/completions/funcsave.fish b/share/completions/funcsave.fish index ad3a8871b..8f86b7bbc 100644 --- a/share/completions/funcsave.fish +++ b/share/completions/funcsave.fish @@ -1,2 +1,4 @@ -complete -c funcsave -xa "(functions -na)" -d "Save function" -complete -c funcsave -s d -l directory -d "Directory to save the functions" -a '$fish_function_path' -r +complete -c funcsave -d "save function(s) to disk" +complete -c funcsave -xa "(functions -na)" +complete -c funcsave -s d -l directory -d "dir to save function(s) into" -a '$fish_function_path' -r +complete -c funcsave -s q -d "suppress output" -r \ No newline at end of file diff --git a/share/functions/funcsave.fish b/share/functions/funcsave.fish index 51963263c..585ef463f 100644 --- a/share/functions/funcsave.fish +++ b/share/functions/funcsave.fish @@ -1,5 +1,5 @@ function funcsave --description "Save the current definition of all specified functions to file" - set -l options h/help q/quiet d/directory= + set -l q options h/help d/directory= argparse -n funcsave $options -- $argv or return