Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an easy way to iterate over available ports #12

Closed
wants to merge 3 commits into from

Conversation

graugans
Copy link
Owner

@graugans graugans commented Apr 15, 2024

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Apr 15, 2024

Codecov Report

Attention: Patch coverage is 0% with 70 lines in your changes are missing coverage. Please review.

Project coverage is 31.28%. Comparing base (c1172a3) to head (d861b48).

Files Patch % Lines
pkg/ovp8xx/portinfo.go 0.00% 44 Missing ⚠️
cmd/ovp8xx/cmd/ports.go 0.00% 26 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##               v2      #12      +/-   ##
==========================================
- Coverage   33.83%   31.28%   -2.56%     
==========================================
  Files          19       21       +2     
  Lines         857      927      +70     
==========================================
  Hits          290      290              
- Misses        566      636      +70     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@graugans
Copy link
Owner Author

graugans commented May 14, 2024

After adding the feature to filter the output with the go text/template package this became obsolete by this command:

ovp8xx get  --format '{{ range $port, $details := .ports }}[{{ $port }}] state: {{ $details.state }},{{print "\t"}}type: {{ $details.info.features.type }},{{print "\t"}}PCIC Port: {{ $details.data.pcicTCPPort }}{{println ""}}{{ end }}'

@graugans
Copy link
Owner Author

Another solution:

ovp8xx get  --format '{{$p := prefix "\n"}}{{ range $port, $details := .ports }}{{call $p}}[{{ $port }}
] state: {{ $details.state }},{{print "\t"}}type: {{ $details.info.features.type }},{{print "\t"}}PCIC Port: {{ $detail
s.data.pcicTCPPort }}{{ end }}'

@graugans graugans closed this May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants