nextcloud / nextcloud/server

Add support for output format to `occ files:scan`

Open
#27,030 7 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.