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

Enable a more interactive CLI via Liner #69

Merged
merged 1 commit into from
Mar 9, 2025

Conversation

Luke-Ed
Copy link
Contributor

@Luke-Ed Luke-Ed commented Mar 8, 2025

Add liner as a dependency, and enable the interactive cli to have a history and the user to iterate through that history

Should provide the functionality requested in: #60, but doesn't use the library in question.

I'll also note, this is my first time working in go, so I'm more than happy for any input.

…istory and the user to iterate through that history
Copy link
Owner

@itzg itzg left a comment

Choose a reason for hiding this comment

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

Very cool!

Do you know if it happens to support piped stdin like if people are cat'ing a file of commands into rcon-cli? I'm not sure if that's a common use case, so probably not a problem if not supported.

@Luke-Ed
Copy link
Contributor Author

Luke-Ed commented Mar 8, 2025

I didn't even think of that as a use case, I'll spin up an environment and play with it a bit.

@Luke-Ed
Copy link
Contributor Author

Luke-Ed commented Mar 8, 2025

Looks like it handles it, at least as I'd expect it too

echo -e "time set day\ndeop Ser_Luke\nlist" | ./rcon-cli --password <omitted>
Set the time to 1000
Made Ser_Luke no longer a server operator
There are 0 of a max of 20 players online: 

@itzg
Copy link
Owner

itzg commented Mar 9, 2025

Thanks for checking that.

@itzg itzg merged commit 8d7a547 into itzg:master Mar 9, 2025
2 checks passed
@Luke-Ed Luke-Ed deleted the enable-interactive-terminal branch March 9, 2025 00:09
@itzg
Copy link
Owner

itzg commented Mar 9, 2025

@itzg itzg mentioned this pull request Mar 9, 2025
@Luke-Ed
Copy link
Contributor Author

Luke-Ed commented Mar 9, 2025

You might also be able to close #10, if you just wanted the history. Although this patch only preserves history for the lifetime of the interactive session (would need to write to a file for longer)

@itzg
Copy link
Owner

itzg commented Mar 9, 2025

Thanks, yeah seems fair to close that one due to this change.

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