lsd-rs / lsd-rs/lsd

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

Open
#956 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
16.2k
Forks
510
PR merge metrics
No merged PRs in 30d

Description

# existing behavior

the `--icon` option requires an argument

````
~ $ lsd --icon
error: a value is required for '--icon ' 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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the CLI definition for `--icon` and any existing tests covering option parsing. Reproduce the current missing-argument error, then verify that a bare `--icon` enables icons while preserving the configured icon theme and other existing modes.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.