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

bluechictl: introduce Method and Command structures #684

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

mkemel
Copy link
Member

@mkemel mkemel commented Jan 4, 2024

This introduces a new way to define and handle command line interface focusing on simplicity of adding and handling new methods and new options for each method separately.

Introducing two new structures: Method and Command, and a set of functions to manage them. client/main.c shows how to define and use these.

Also, Command interface can handle separate help outputs for each method, which can be introduced later.

Solves #324

@mkemel mkemel force-pushed the bluechictl-restructure branch 4 times, most recently from 62eab85 to 97c2945 Compare January 4, 2024 13:53
@mkemel mkemel marked this pull request as ready for review January 4, 2024 14:08
Copy link
Member

@engelmi engelmi left a comment

Choose a reason for hiding this comment

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

A few comments, but overall great work!

src/client/main.c Outdated Show resolved Hide resolved
src/client/methods.c Outdated Show resolved Hide resolved
src/client/main.c Outdated Show resolved Hide resolved
src/client/main.c Outdated Show resolved Hide resolved
src/client/main.c Outdated Show resolved Hide resolved
src/client/main.c Outdated Show resolved Hide resolved
src/client/methods.c Outdated Show resolved Hide resolved
src/client/methods.h Outdated Show resolved Hide resolved
src/client/main.c Outdated Show resolved Hide resolved
src/client/main.c Outdated Show resolved Hide resolved
src/client/method-list-units.c Outdated Show resolved Hide resolved
src/client/method-list-units.c Outdated Show resolved Hide resolved
src/client/method-metrics.c Outdated Show resolved Hide resolved
src/client/method-unit-actions.c Outdated Show resolved Hide resolved
src/client/method-unit-actions.c Outdated Show resolved Hide resolved
src/libbluechi/cli/command.c Show resolved Hide resolved
src/libbluechi/cli/command.c Outdated Show resolved Hide resolved
src/libbluechi/cli/command.c Show resolved Hide resolved
@mkemel mkemel force-pushed the bluechictl-restructure branch 2 times, most recently from 8fbf0e0 to 74220e4 Compare January 7, 2024 13:59
@mkemel
Copy link
Member Author

mkemel commented Jan 7, 2024

@ygalblum @engelmi Thanks for reviews, addressed all your comments and also did some more refinements.
You can take another look :)

src/client/main.c Show resolved Hide resolved
src/client/method-list-units.h Outdated Show resolved Hide resolved
@mkemel mkemel force-pushed the bluechictl-restructure branch 2 times, most recently from 8adb741 to 83698a4 Compare January 8, 2024 08:36
Copy link
Member

@engelmi engelmi left a comment

Choose a reason for hiding this comment

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

A small NIT, otherwise LGTM :)

src/client/main.c Outdated Show resolved Hide resolved
@ygalblum
Copy link
Contributor

ygalblum commented Jan 8, 2024

LGTM

@mkemel mkemel force-pushed the bluechictl-restructure branch 3 times, most recently from 530b345 to dfb78de Compare January 8, 2024 11:27
This introduces a new way to define and handle command line interface
focusing on simplicity of adding and handling new methods and new
options for each method separately.

Introducing two new structures: Method and Command, and a set of
functions to manage them. client/main.c shows how to define and use
these.

Also, Command interface can handle separate help outputs for each
method, which can be introduced later.

Signed-off-by: Mark Kemel <mkemel@redhat.com>
@mkemel mkemel merged commit 7e6ed4f into eclipse-bluechi:main Jan 8, 2024
18 checks passed
@mkemel mkemel deleted the bluechictl-restructure branch January 10, 2024 13:45
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.

3 participants