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

Use of cobra package to refactor CLI #172

Draft
wants to merge 29 commits into
base: development
Choose a base branch
from

Conversation

arnabghose997
Copy link
Collaborator

@arnabghose997 arnabghose997 commented May 31, 2024

Closes #160

NOTE: Must be merged only after PR #190 is merged

This PR intends to refactor the existing CLI by using the cobra CLI Golang package. Refer here for details of cobra package.

Refer here for the CLI documentation

Following are key highlights of this PR:

  • The Command struct has been renamed to CommandConfig in order to avoid confusion with the Command struct of cobra package.
  • Commands have been grouped in a hierarchical manner. Refer here for more details.
  • Command flags are prefixed with double hyphen (--) instead of single hyphen (-). Flag names are have not been changed. Ever command now displays only those flags which are associated with their operation. addr and port are the only Global flags because of their usage in almost every command.
  • Following existing commands have been removed:
Comand Reason
setupDID Implemented logic is exactly same as RegisterDID (Refer here)
getTokenBlock No Implementation (Refer here)
  • path.Join() has been used, instead simple + operation, for cleaner file path concatenation.
  • In tests/node/command.py The -grpcPort flag has been removed from commands wherever it is not required.
  • Changes in root README.md

@arnabghose997 arnabghose997 added documentation Improvements or additions to documentation enhancement New feature or request labels May 31, 2024
@arnabghose997 arnabghose997 self-assigned this May 31, 2024
@arnabghose997 arnabghose997 linked an issue May 31, 2024 that may be closed by this pull request
@arnabghose997 arnabghose997 requested a review from thewebchap May 31, 2024 05:33
arnabghose997 and others added 22 commits May 31, 2024 11:45
Using the command "decodetokenchain" users will be able to decode the already dumped tokenchian existing in dump.json file
@arnabghose997 arnabghose997 marked this pull request as ready for review July 29, 2024 03:13
@arnabghose997 arnabghose997 marked this pull request as draft October 28, 2024 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate CLI to use cobra package
3 participants