Skip to content

Option --icon with absent mode argument should be equivalent to --icon always #956

@turbocrime

Description

@turbocrime

existing behavior

the --icon option requires an argument

~ $ lsd --icon
error: a value is required for '--icon <MODE>' but none was supplied
  [possible values: always, auto, never]
~ $ 

expected behavior

the --icon option with no argument should enable icons

~ $ lsd --icon
📂 Desktop  📂 Developer  📂 Documents  📂 Downloads  📂 Library  📂 Movies  📂 Music  📂 Pictures  📂 Public
~ $

details

it is reasonable to assume that manual application of an --icon option with no arguments intends --icon always

in my ~/.config/lsd/config.yml i have

icons:
  when: never
  theme: unicode

i have many short aliases defined in my .zshrc for various modes and behaviors, none of them involving icons.

occasionally, i might want to display icons. it would be nice to simply run lsd --icon (or any of my aliases, with an icon option) to activate icon display.

i understand this feature might have been deliberately avoided due to the possibility for accidental application of following file name arguments or expanded glob values following a bare --icon option. this type of mistake is already a well-understood possibility, and the broadly accepted solution is a standard -- options-terminating sentinel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions