Unified table output #14
Labels
No Label
kind/breaking
kind/bug
kind/build
kind/dependency
kind/deployment
kind/docs
kind
enhancement
kind
feature
kind/proposal
kind
question
kind
refactor
kind/security
kind/testing
kind/translation
priority/critical
priority/high
priority/low
priority/medium
reviewed/duplicate
reviewed/invalid
reviewed/wontfix
skip-changelog
status/blocked
status/has-backport
status/has-pull
status/needs-backport
status/needs-feedback
status/needs-reviews
status/wip
upstream/gitea
upstream/sdk
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gitea/tea#14
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Author: @root360-AndreasUlm
Hi,
currently every function printing information handles the output format on its own.
That the format cannot be changed easily e.g. in case '\t' is not available (see discussion in #13) and is not unified.
IMHO a central function for handling output in different formats (e.g. table, JSON) would improve the output of all functions to look unified.
The central output functions could handle the delimiter.
A first idea is to add function to pring table based output which gets a dictionary like this:
With this information the table output function can generate a header and print the values.
As all values to be printed are known at this stage the output can even be vertically aligned.
Regards,
Andreas
Author: @root360-AndreasUlm
I'm currently implementing the unified output. (https://github.com/root360-AndreasUlm/tea/tree/unified_output_function)
At the moment I'm testing the implementation with all available subcommands.
@lunny When I'm done I'll create PRs for the new functions and every subcommand or should I just create one PR with all changes?
Author: @lunny
I'm OK. Since the PR title will be unified table output.
Author: @noerw
IMO, there ideally should be at least one format that is:
That would cover the 3 most common use cases of CLI apps (automation, quick skimming of data, fast access to full data)
Author: @root360-AndreasUlm
@noerw thanks for the use-cases, I'll implement some of those
Author: @root360-AndreasUlm
@lunny finished initial implementation
Out of the cases @noerw mentioned the following are implemented:
@root360-AndreasUlm The formatters are implemented but no command uses them yet, right? At least I can't get the
-o
flag to affect output.Edit: found the bug, will send PR
noerw referenced this issue2019-10-25 12:48:08 +00:00