Skip to content

feat: implement --tree option for oli ls subcommand#6311

Merged
Xuanwo merged 3 commits intoapache:mainfrom
waynexia:oli-ls-tree
Jun 19, 2025
Merged

feat: implement --tree option for oli ls subcommand#6311
Xuanwo merged 3 commits intoapache:mainfrom
waynexia:oli-ls-tree

Conversation

@waynexia
Copy link
Copy Markdown
Member

Signed-off-by: Ruihang Xia waynestxia@gmail.com# Which issue does this PR close?

Related to #422

Rationale for this change

Tree view is easier to read for deep folders

What changes are included in this PR?

Implement oli ls --tree/oli ls -T for listing with tree view. E.g.:

> oli ls -T ./src

.
├── bin/
│   └── oli.rs
├── commands/
│   ├── bench/
│   │   ├── mod.rs
│   │   ├── report.rs
│   │   └── suite.rs
│   ├── cat.rs
│   ├── cp.rs
│   ├── edit.rs
│   ├── ls.rs
│   ├── mod.rs
│   ├── mv.rs
│   ├── rm.rs
│   ├── stat.rs
│   └── tee.rs
├── config/
│   └── mod.rs
├── lib.rs
├── params/
│   ├── config.rs
│   └── mod.rs
└── utils/

Are there any user-facing changes?

Yes, a new option

waynexia added 2 commits June 18, 2025 11:37
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
@waynexia waynexia requested a review from Xuanwo as a code owner June 18, 2025 04:26
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. releases-note/feat The PR implements a new feature or has a title that begins with "feat" labels Jun 18, 2025
.success();

let output = String::from_utf8(t.get_output().stdout.clone())?;
let expected = r#".
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the same snapshot testing method so that we don't have to update this manually?

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
@waynexia waynexia requested a review from Xuanwo June 18, 2025 06:48
Copy link
Copy Markdown
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @waynexia for working on this!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 19, 2025
@Xuanwo Xuanwo merged commit d0bc873 into apache:main Jun 19, 2025
17 checks passed
@waynexia waynexia deleted the oli-ls-tree branch June 19, 2025 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer releases-note/feat The PR implements a new feature or has a title that begins with "feat" size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants