Skip to content

Commit

Permalink
Put function arguments first before description
Browse files Browse the repository at this point in the history
Arguments are more important and thus is makes sense to put them first so the person reading the code can get to them sooner.
FWIW I took a survey of several repos and all but one of them (of the ones that used both -a and -d flags) put the description last.
Resolves #38
  • Loading branch information
PatrickF1 committed Sep 24, 2020
1 parent 43637b5 commit 87cf0d4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion functions/__fzf_display_value_or_error.fish
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# helper function for __fzf_search_shell_variables
function __fzf_display_value_or_error --description "Displays either the value of the variable passed in, or an informative message if it is not available." --argument-names variable_name
function __fzf_display_value_or_error --argument-names variable_name --description "Displays either the value of the variable passed in, or an informative message if it is not available."
if set --query $variable_name
echo $$variable_name
else
Expand Down
2 changes: 1 addition & 1 deletion functions/__fzf_preview_file.fish
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# helper function for __fzf_search_current_dir
function __fzf_preview_file --description "Prints a preview for the given file based on its file type." --argument-names file_path
function __fzf_preview_file --argument-names file_path --description "Prints a preview for the given file based on its file type."
if test -f "$file_path" # regular file
bat --style=numbers --color=always "$file_path"
else if test -d "$file_path" # directory
Expand Down
2 changes: 1 addition & 1 deletion functions/__fzf_report_file_type.fish
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# helper function for __fzf_preview_file
function __fzf_report_file_type --description "Explain the file type for a file." --argument-names file_path file_type
function __fzf_report_file_type --argument-names file_path file_type --description "Explain the file type for a file."
set_color red
echo "Cannot preview '$file_path': it is a $file_type."
set_color normal
Expand Down

0 comments on commit 87cf0d4

Please sign in to comment.