Repository: eza-community/eza (language: rust)

Issue:
bug: Test and fix all bash completions
Bash completions have been a bit unloved, we should go through and test/fix them.


Discussion / hints:
Save time by removing all completions and use this instead: https://docs.rs/clap_complete/4.4.1/clap_complete/
Depends on #197
I'll add that version `0.18.20` added the `--show-symlinks` flag (_yay!_) but did **NOT** add it to the bash completions file. Version `0.18.21` might have the same issue with the zsh completions.

@daviessm @cafkafk
The issue persists in release `0.20.1`. The new options `--follow-symlinks` and `--group-directories-last` were added to --help and auto-complete, but _at least_ `--show-symlinks` and `--no-symlinks` are missing.

**Solution:** After looking at the bash completion file [eza](https://github.com/eza-community/eza/blob/main/completions/bash/eza), I believe it is simply a matter of adding all the missing options to `eza --help`. If we do so, they seem to be automatically loaded.

I lack the expertise to make such changes, but perhaps an external contributor can update the `eza --help`?

@daviessm @cafkafk 
> I believe it is simply a matter of adding all the missing options to `eza --help`. If we do so, they seem to be automatically loaded.

What makes you believe that is the case?  Could you link to a mechanism in native bash that creates completions from help output?

Also, for what it's worth, creating a contribution that adds flags to the help flag is an easy first contribution for anyone interested.
@cafkafk My programming skill is very rusty, but the autocomplete file seems to gather the flags from --help, as shown here:
https://github.com/eza-community/eza/blob/74fed8cefc2625cb75e621ff5aeb9611691d5c0d/completions/bash/eza#L57-L64

Specifically this
```bash
parse_help=$(eza --help | grep -oE ' (--[[:alnum:]@-]+)' | tr -d ' ' | grep -v '\--colo') 
```

(Also, thank you for all your work in maintaining this repo. It is amazing software. ❤️)

Fix patch:
diff --git a/src/options/help.rs b/src/options/help.rs
index a715a2901..4bcea8695 100644
--- a/src/options/help.rs
+++ b/src/options/help.rs
@@ -14,7 +14,7 @@ static USAGE_PART1: &str = "Usage:
   eza [options] [files...]
 
 META OPTIONS
-  --help                     show list of command-line options
+  -?, --help                 show list of command-line options
   -v, --version              show version of eza
 
 DISPLAY OPTIONS
@@ -42,13 +42,15 @@ FILTERING AND SORTING OPTIONS
                              show the '.' and '..' directories
   -A, --almost-all           equivalent to --all; included for compatibility with `ls -A`
   -d, --list-dirs            list directories as files; don't list their contents
+  -D, --only-dirs            list only directories
+  -f, --only-files           list only files
+  --show-symlinks            explicitly show symbolic links (for use with --only-dirs | --only-files)
+  --no-symlinks              do not show symbolic links
   -L, --level DEPTH          limit the depth of recursion
   -r, --reverse              reverse the sort order
   -s, --sort SORT_FIELD      which field to sort by
   --group-directories-first  list directories before other files
   --group-directories-last   list directories after other files
-  -D, --only-dirs            list only directories
-  -f, --only-files           list only files
   -I, --ignore-glob GLOBS    glob patterns (pipe-separated) of files to ignore";
 
 static GIT_FILTER_HELP: &str = "  \
@@ -56,7 +58,7 @@ static GIT_FILTER_HELP: &str = "  \
 
 static USAGE_PART2: &str = "  \
   Valid sort fields:         name, Name, extension, Extension, size, type,
-                             modified, accessed, created, inode, and none.
+                             created, modified, accessed, changed, inode, and none.
                              date, time, old, and new all refer to modified.
 
 LONG VIEW OPTIONS
@@ -67,12 +69,12 @@ LONG VIEW OPTIONS
   -h, --header               add a header row to each column
   -H, --links                list each file's number of hard links
   -i, --inode                list each file's inode number
-  -m, --modified             use the modified timestamp field
   -M, --mounts               show mount details (Linux and Mac only)
   -n, --numeric              list numeric user and group IDs
   -O, --flags                list file flags (Mac, BSD, and Windows only)
   -S, --blocksize            show size of allocated file system blocks
   -t, --time FIELD           which timestamp field to list (modified, accessed, created)
+  -m, --modified             use the modified timestamp field
   -u, --accessed             use the accessed timestamp field
   -U, --created              use the created timestamp field
   --changed                  use the changed timestamp field
@@ -81,8 +83,8 @@ LONG VIEW OPTIONS
                              like '+%Y-%m-%d %H:%M')
   --total-size               show the size of a directory as the size of all
                              files and directories inside (unix only)
-  --no-permissions           suppress the permissions field
   -o, --octal-permissions    list each file's permission in octal format
+  --no-permissions           suppress the permissions field
   --no-filesize              suppress the filesize field
   --no-user                  suppress the user field
   --no-time                  suppress the time field
@@ -93,7 +95,9 @@ static GIT_VIEW_HELP: &str = "  \
   --git                      list each file's Git status, if tracked or ignored
   --no-git                   suppress Git status (always overrides --git,
                              --git-repos, --git-repos-no-status)
-  --git-repos                list root of git-tree status";
+  --git-repos                list root of git-tree status
+  --get-repos-no-status      list each git-repos branch name (much faster)
+    ";
 static EXTENDED_HELP: &str = "  \
   -@, --extended             list each file's extended attributes and sizes";
 static SECATTR_HELP: &str = "  \


Test patch: