Add support for output format to `occ files:scan`
Open
Nobody has claimed this yet.
1. to develop
25-feedback
bug
feature: occ
good first issue
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
Steps to reproduce
1.occ files:scan --output=json_pretty -- user
{"reqId":"UPIugY3Zgb2Oo5c0EFiw","level":1,"time":"2021-05-19T10:20:31+00:00","remoteAddr":"","user":"--","app":"admin_audit","method":"","url":"--","message":"Console command executed: files:scan --output=json_pretty -- user","userAgent":"--","version":"19.0.8.1"}
Unknown user 1 user
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 0 | 0 | 00:00:00 |
+---------+-------+--------------+
occ files:scan --output=json -- user
{"reqId":"71yPn7HwMRty0OuhXFXH","level":1,"time":"2021-05-19T10:20:40+00:00","remoteAddr":"","user":"--","app":"admin_audit","method":"","url":"--","message":"Console command executed: files:scan --output=json -- user","userAgent":"--","version":"19.0.8.1"}
Unknown user 1 user
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 0 | 0 | 00:00:00 |
+---------+-------+--------------+
occ files:scan --output=plain -- user
{"reqId":"7SR7CkmnEtTrcZXtfYFX","level":1,"time":"2021-05-19T10:20:46+00:00","remoteAddr":"","user":"--","app":"admin_audit","method":"","url":"--","message":"Console command executed: files:scan --output=plain -- user","userAgent":"--","version":"19.0.8.1"}
Unknown user 1 user
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 0 | 0 | 00:00:00 |
+---------+-------+--------------+
Expected behaviour
The output format should actually change. In conjunction with #27029 this makes parsing for errors even harder.
Server configuration
Nextcloud version:
19.0.8.1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the implementation of the occ files:scan command and reproduce the three --output examples from the issue. Trace how the requested output format is parsed and rendered, then verify that each format changes the command output and that errors remain distinguishable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100