From 1c2323e76f4fda3f2bfbdf8ec90cbcb5d3489bb8 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Fri, 31 Jul 2020 12:06:40 -0700 Subject: [PATCH] Use dashes instead of underscores pervasively in tutorial anchors This fixes some broken help completions. --- doc_src/tutorial.rst | 8 +++--- share/completions/help.fish | 50 ++++++++++++++++++------------------- share/functions/help.fish | 2 +- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/doc_src/tutorial.rst b/doc_src/tutorial.rst index d93989b04..3e4734bf9 100644 --- a/doc_src/tutorial.rst +++ b/doc_src/tutorial.rst @@ -265,7 +265,7 @@ To give a variable to an external command, it needs to be "exported". Unlike oth It can also be unexported with ``--unexport`` or ``-u``. -.. _tut_lists: +.. _tut-lists: Lists ----- @@ -380,7 +380,7 @@ Unlike other shells, fish does not split command substitutions on any whitespace -lglib-2.0 -.. _tut_semicolon: +.. _tut-semicolon: Separating Commands (Semicolon) ------------------------------- @@ -434,7 +434,7 @@ fish also supports :ref:`and `, :ref:`or `, and :ref:`not `, this can also be written in multiple lines, like so:: +As mentioned in :ref:`the section on the semicolon `, this can also be written in multiple lines, like so:: cp file1.txt file1_bak.txt && cp file2.txt file2_bak.txt and echo "Backup successful" @@ -606,7 +606,7 @@ You can choose among some sample prompts by running ``fish_config prompt``. ``fi $PATH ----- -``$PATH`` is an environment variable containing the directories that ``fish`` searches for commands. Unlike other shells, $PATH is a :ref:`list `, not a colon-delimited string. +``$PATH`` is an environment variable containing the directories that ``fish`` searches for commands. Unlike other shells, $PATH is a :ref:`list `, not a colon-delimited string. To prepend /usr/local/bin and /usr/sbin to ``$PATH``, you can write:: diff --git a/share/completions/help.fish b/share/completions/help.fish index cb58d120c..583f9a766 100644 --- a/share/completions/help.fish +++ b/share/completions/help.fish @@ -74,28 +74,28 @@ complete -c help -x -a completion-path -d 'Where to put completions' # Tutorial complete -c help -x -a tutorial -d Tutorial -complete -c help -x -a tut_autoload -d 'Autoloading Functions' -complete -c help -x -a tut_autosuggestions -d Autosuggestions -complete -c help -x -a tut_combiners -d 'Combiners (And, Or, Not)' -complete -c help -x -a tut_command_substitutions -d 'Command Substitutions' -complete -c help -x -a tut_conditionals -d 'Conditionals (If, Else, Switch)' -complete -c help -x -a tut_exit_status -d 'Exit Status' -complete -c help -x -a tut_exports -d 'Exports (Shell Variables)' -complete -c help -x -a tut_functions -d Functions -complete -c help -x -a tut_getting_help -d 'Getting Help' -complete -c help -x -a tut_learning_Fish -d 'Learning fish' -complete -c help -x -a tut_lists -d Lists -complete -c help -x -a tut_loops -d Loops -complete -c help -x -a tut_more -d 'Ready for more?' -complete -c help -x -a tut_path -d '$PATH' -complete -c help -x -a tut_pipes_and_redirections -d 'Pipes and Redirections' -complete -c help -x -a tut_prompt -d Prompt -complete -c help -x -a tut_running_commands -d 'Running Commands' -complete -c help -x -a tut_semicolon -d 'Separating Commands (Semicolon)' -complete -c help -x -a tut_startup -d "Startup (Where's .bashrc?)" -complete -c help -x -a tut_syntax_highlighting -d 'Syntax Highlighting' -complete -c help -x -a tut_tab_completions -d 'Tab Completions' -complete -c help -x -a tut_universal -d 'Universal Variables' -complete -c help -x -a tut_variables -d Variables -complete -c help -x -a tut_why_fish -d 'Why fish?' -complete -c help -x -a tut_wildcards -d Wildcards +complete -c help -x -a tut-autoload -d 'Autoloading Functions' +complete -c help -x -a tut-autosuggestions -d Autosuggestions +complete -c help -x -a tut-combiners -d 'Combiners (And, Or, Not)' +complete -c help -x -a tut-command_substitutions -d 'Command Substitutions' +complete -c help -x -a tut-conditionals -d 'Conditionals (If, Else, Switch)' +complete -c help -x -a tut-exit_status -d 'Exit Status' +complete -c help -x -a tut-exports -d 'Exports (Shell Variables)' +complete -c help -x -a tut-functions -d Functions +complete -c help -x -a tut-getting_help -d 'Getting Help' +complete -c help -x -a tut-learning_Fish -d 'Learning fish' +complete -c help -x -a tut-lists -d Lists +complete -c help -x -a tut-loops -d Loops +complete -c help -x -a tut-more -d 'Ready for more?' +complete -c help -x -a tut-path -d '$PATH' +complete -c help -x -a tut-pipes_and_redirections -d 'Pipes and Redirections' +complete -c help -x -a tut-prompt -d Prompt +complete -c help -x -a tut-running_commands -d 'Running Commands' +complete -c help -x -a tut-semicolon -d 'Separating Commands (Semicolon)' +complete -c help -x -a tut-startup -d "Startup (Where's .bashrc?)" +complete -c help -x -a tut-syntax_highlighting -d 'Syntax Highlighting' +complete -c help -x -a tut-tab_completions -d 'Tab Completions' +complete -c help -x -a tut-universal -d 'Universal Variables' +complete -c help -x -a tut-variables -d Variables +complete -c help -x -a tut-why_fish -d 'Why fish?' +complete -c help -x -a tut-wildcards -d Wildcards diff --git a/share/functions/help.fish b/share/functions/help.fish index c47619424..9fc53312c 100644 --- a/share/functions/help.fish +++ b/share/functions/help.fish @@ -121,7 +121,7 @@ function help --description 'Show help for the fish shell' set fish_help_page "cmds/$fish_help_item.html" case 'completion-*' set fish_help_page "completions.html#$fish_help_item" - case 'tut_*' + case 'tut-*' set fish_help_page "tutorial.html#"(string sub -s 5 -- $fish_help_item | string replace -a -- _ -) case tutorial set fish_help_page "tutorial.html"