Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Match kubectl table style for simpler scripting#1363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
kylecarbs merged 1 commit intomainfromlistfmt
May 10, 2022
Merged

Conversation

kylecarbs
Copy link
Member

@kylecarbskylecarbs commentedMay 10, 2022
edited
Loading

Fixes#1322.

image

@kylecarbskylecarbs self-assigned thisMay 10, 2022
@codecov
Copy link

codecovbot commentedMay 10, 2022
edited
Loading

Codecov Report

Merging#1363 (6e65e6f) intomain (b675aec) willincrease coverage by0.32%.
The diff coverage is54.45%.

@@            Coverage Diff             @@##             main    #1363      +/-   ##==========================================+ Coverage   66.69%   67.01%   +0.32%==========================================  Files         284      287       +3       Lines       18614    18762     +148       Branches      235      235              ==========================================+ Hits        12414    12573     +159+ Misses       4931     4902      -29- Partials     1269     1287      +18
FlagCoverage Δ
unittest-go-macos-latest54.22% <54.45%> (+0.33%)⬆️
unittest-go-postgres-65.61% <54.45%> (+0.21%)⬆️
unittest-go-ubuntu-latest56.62% <54.45%> (+0.32%)⬆️
unittest-go-windows-202252.54% <54.45%> (+0.17%)⬆️
unittest-js73.67% <ø> (ø)
Impacted FilesCoverage Δ
cli/templatelist.go10.81% <0.00%> (+0.81%)⬆️
cli/list.go47.05% <47.36%> (+37.53%)⬆️
cli/cliui/table.go48.00% <48.00%> (ø)
cli/root.go79.72% <100.00%> (+0.28%)⬆️
cli/userlist.go82.85% <100.00%> (+13.89%)⬆️
coderd/workspaceagents.go56.04% <0.00%> (-1.87%)⬇️
codersdk/users.go63.79% <0.00%> (-0.62%)⬇️
peer/conn.go79.60% <0.00%> (-0.50%)⬇️
codersdk/client.go59.74% <0.00%> (ø)
codersdk/templates.go60.37% <0.00%> (ø)
... and14 more

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last updateb675aec...6e65e6f. Read thecomment docs.


// Table creates a new table with standardized styles.
func Table() table.Writer {
tableWriter := table.NewWriter()
Copy link
Contributor

Choose a reason for hiding this comment

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

Not to bikeshed on this, but Go had a stdlib solution for this:https://pkg.go.dev/text/tabwriter. Haven't taken a look at this package though

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh actually nvm, I thought u were totally switching out the table packages

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Oh, nah. This package handles hiding columns and sorting which is kinda nice.

Copy link
Contributor

Choose a reason for hiding this comment

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

ye i agree, should've looked through more b4 commenting

Comment on lines +49 to +50
cmd.Flags().StringArrayVarP(&columns, "column", "c", nil,
"Specify a column to filter in the table.")
Copy link
Contributor

Choose a reason for hiding this comment

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

To filter by multiple columns, do you need to specify the flag multiple times? Or can it accept a comma delimited string? I think we should document how to specify multiple.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

You have to specify multiple, but the flag does specify the type as doing so.

@kylecarbskylecarbs merged commite0a7aec intomainMay 10, 2022
@kylecarbskylecarbs deleted the listfmt branchMay 10, 2022 20:57
@missknissmisskniss added this to theV2 Beta milestoneMay 15, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@coadlercoadlercoadler approved these changes

@deansheatherdeansheatherAwaiting requested review from deansheather

Assignees

@kylecarbskylecarbs

Labels
None yet
Projects
None yet
Milestone
V2 Beta
Development

Successfully merging this pull request may close these issues.

Terminal "niceties" make it difficult to script coder
3 participants
@kylecarbs@coadler@misskniss

[8]ページ先頭

©2009-2025 Movatter.jp