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

how to add a pause to see plugins output? #1098

Open
fragolinux opened this issue Apr 23, 2021 · 6 comments
Open

how to add a pause to see plugins output? #1098

fragolinux opened this issue Apr 23, 2021 · 6 comments
Labels
question Further information is requested

Comments

@fragolinux
Copy link
Contributor




I'd like to add a pause after i run a plugin which produces output, to actually SEE that output, or even scroll it in case of formatted logs generated by a plugin... how can this be done? Thanks

example, i'd like to add helm suspend and resume, and to do tests i'm just doing "status" for now, but i can't see anything other than a flicker when i press ctrl-p

plugin:
  helm-status:
    shortCut: Ctrl-P
    description: Helm status
    scopes:
    - hr
    command: helm
    background: false
    args:
    - status
    - $NAME
    - -n
    - $NAMESPACE
@derailed derailed added the question Further information is requested label Apr 27, 2021
@derailed
Copy link
Owner

@fragolinux Yes that is correct. There is nothing here to hold the output and hence the plugin finishes right away. You can use a script here to hold the output and fire it off in the plugin.

@fragolinux
Copy link
Contributor Author

@derailed actually it was not that complicated, I saw this in one of the latest Viktor Farcic videos :)
image

@laurentdroin
Copy link

Works great, thank you.
In my case, the | less messed up the formatting. I replaced it with ; read -p ''
Just in case it helps.

@jadolg
Copy link

jadolg commented Apr 11, 2024

This is unfortunately not working for me. Maybe it's possible to add a configuration for it?

@fragolinux
Copy link
Contributor Author

@jadolg what do you mean? i just tried and it works... beware that config files naming changed recently, i think in 0.3x, now the plugin file is named differently, and even the yaml inside changed its root topic...

@jadolg
Copy link

jadolg commented Apr 12, 2024

@fragolinux the plugins I can see and use without issues. What's failing for me is the wait in the end.
I'm using my own application, maybe I'm missing something in the app itself, but it's a simple do-stuff log to standard output app.

szero-down:
    shortCut: Shift-D
    confirm: true
    dangerous: true
    description: Scale all deployments down
    scopes:
      - namespace
    command: sh
    background: false
    args:
      - -c
      - "szero down --context $CONTEXT --namespace $NAME; read -p ''"

This will do what's supposed to do but it won't wait.
I'm installing from source with go install and I'm running the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants