jethrokuan / z

Pure-fish z directory jumping
MIT License
1.29k stars 45 forks source link

Remove unreachable --list logic #89

Closed sudormrfbin closed 4 years ago

sudormrfbin commented 4 years ago

The --list option is processed here first with an if construct: https://github.com/jethrokuan/z/blob/34d35b587012e9319dcc25cc73b02adeb11a8ce7/functions/__z.fish#L143-L147

It is checked for and acted upon again here, inside the else part of the aforementioned if conditional: https://github.com/jethrokuan/z/blob/34d35b587012e9319dcc25cc73b02adeb11a8ce7/functions/__z.fish#L159-L162

The second check will never run:

  1. If _flag_list is set, the awk part is executed and the function returns (the if conditional is the last block in the function).
  2. If _flag_list is not set, neither the awk part or the tr part is executed.