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

Option to ignore "fluff" when using the --cmd flag #37

Closed
hsommerlandreason opened this issue Nov 8, 2023 · 2 comments
Closed

Option to ignore "fluff" when using the --cmd flag #37

hsommerlandreason opened this issue Nov 8, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@hsommerlandreason
Copy link

It would be very nice to have the opportunity to ignore printing the additional information when using the --cmd flag in order to make piping easier.

As of now if i run: ecsgo -n xxxxxxxxxx -t xxxxxxx -u xxxxx -c 'echo "hello"' > testsson.txt

testsson.txt will contain all of this.

Cluster: xxxxxx | Service:  | Task: xxxxxxxxxxxx | Cmd: echo "hello"
Connecting to container xxxxxxxxxxxxx

Starting session with SessionId: ecs-execute-command-xxxxxxxxxxxxxx
hello


Exiting session with sessionId: ecs-execute-command-xxxxxxxxx.

It would be very convenient not to have to strip the excess info manually.

@tedsmitt
Copy link
Owner

I think the best I can do is remove the first few lines i.e.

Cluster: xxxxxx | Service:  | Task: xxxxxxxxxxxx | Cmd: echo "hello"
Connecting to container xxxxxxxxxxxxx

Since the remaining Starting session with SessionId... is printed from the session-manager-plugin. It might be troublesome to remove that text. It looks like there is an open issue for this on the session-manager-plugin repo though.

Would you be happy for me to add a -q flag to disable the aforementioned lines? Something like

ecsgo -q -n test-ecsgo -t  584c7724322e4d41a4d560523aacc745 -u nginx -c 'echo hello'

Starting session with SessionId: ecs-execute-command-0eb8eff6298eef532
hello


Exiting session with sessionId: ecs-execute-command-0eb8eff6298eef532.

@tedsmitt
Copy link
Owner

tedsmitt commented Dec 29, 2023

@hsommerlandreason added a --quiet flag in v0.5.0, this is probably the best we can do until aws/session-manager-plugin#85 is addressed.

@tedsmitt tedsmitt added the enhancement New feature or request label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants