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

feat(cli): standardise a top level output format for all lotus CLIs #12868

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

shobit000
Copy link

@shobit000 shobit000 commented Feb 4, 2025

Related Issues

This PR addresses issue #12616 regarding the standardization of the output format for all Lotus CLIs.

Proposed Changes

The changes include:

  1. Added a new --output flag to the Lotus CLI that can be used to specify the output format.
  2. Updated the cli/chain.go, cli/miner/miner.go, cli/cmd.go, and cli/index.go files to support the --output flag.
  3. Added a new cli/util/output.go file that contains the implementation of the FormatOutput function, which is used to format the output of CLI commands based on the --output flag.

This pull request includes several changes to the CLI commands and introduces a standardized output format for all Lotus CLI commands. The most important changes include the removal of some developer and network commands, the addition of new CLI commands for managing the chain index and miner, and the introduction of a utility function for formatting output.

Motivation

Motivation:

The --output flag facilitates programmatic use of Lotus CLI commands, supporting JSON and text formats for easier parsing and processing with tools like jq.

Changes:

cli/chain.go: Updated to support the --output flag and format the output accordingly.
cli/miner/miner.go: Updated to support the --output flag and format the output accordingly.
cli/cmd.go: Updated to support the --output flag and format the output accordingly.
cli/index.go: Updated to support the --output flag and format the output accordingly.
cli/util/output.go: New file that contains the implementation of the FormatOutput function.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

@rjan90 rjan90 changed the title Standardise a top level output format for all lotus CLIs #12616 feat(cli): standardise a top level output format for all lotus CLIs Feb 4, 2025
@github-actions github-actions bot dismissed their stale review February 4, 2025 07:26

PR title now matches the required format.

@rjan90 rjan90 requested a review from masih February 4, 2025 07:26
@rjan90
Copy link
Contributor

rjan90 commented Feb 4, 2025

Thank you for your pull request, @shobit000! I've refined the title to ensure it meets the "PR title check" criteria. I've also assigned Masih as the reviewer for your PR. He will review it shortly and provide feedback.

@shobit000
Copy link
Author

ok

Copy link
Member

@masih masih left a comment

Choose a reason for hiding this comment

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

Please make sure the CI is green before re-requesting review.

@shobit000
Copy link
Author

any updates ??

@rjan90 rjan90 requested a review from masih February 10, 2025 13:14
@rjan90 rjan90 added the skip/changelog This change does not require CHANGELOG.md update label Feb 10, 2025
Copy link
Member

@masih masih left a comment

Choose a reason for hiding this comment

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

Please rebase your branch atop master. The diff does't seem right.

@@ -0,0 +1,33 @@
# .github/workflows/stale-branches.yml
Copy link
Member

Choose a reason for hiding this comment

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

Rebase gone wrong?

@BigLep
Copy link
Member

BigLep commented Feb 11, 2025

I'm going to approve and run workflows so @shobit000 can see the CI state. (From a safety regard, since the PR is from a fork, this will use GitHub runners.)

@BigLep
Copy link
Member

BigLep commented Feb 11, 2025

@shobit000 : when CI is passing, please go ahead and re-request review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip/changelog This change does not require CHANGELOG.md update
Projects
Status: ⌨️ In Progress
Development

Successfully merging this pull request may close these issues.

4 participants