You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of our goals is to make CLI environment safer and more stable as it is the entry point into language. Better architecture can help achieve this goal and save time implementing features or debugging unexpected behaviors.
StructOpt simplifies argument descriptions and shortens the code.
Anyhow simplifies error handling in general and allows focusing on features.
This is only reorganization, not a refactoring. Every command can be simply placed into new Cmd wrappers with its arguments specified. So no functionality is going to be lost in the process. You can run examples from the repo and see that they work (1) and contain the same code as current Leo CLI.
StructOpt is Clap but better on definitions.
Estimates
Should take about 2 days to copy-paste commands and do some cosmetics and docs.
What it brings
It also creates space for future optimizations such as putting manifest into context, having common handlers and structures for APIs and makes code more readable and upgradable.
The text was updated successfully, but these errors were encountered:
Features:
- introduces new Command and Route traits for Leo commands and Aleo PM API
- most of the CLI code replace with higher-level abstraction - StructOpt
- anyhow used for error handling, no more custom error classes
- improves API - now every status code has its business logic
- adds global flags (e.g. --quiet to suppress output)
- error messages improved for convenience and better user experience
Closes:
- #604
- #599
- #584
- #277
- #376
💥 Proposal
Motivation
One of our goals is to make CLI environment safer and more stable as it is the entry point into language. Better architecture can help achieve this goal and save time implementing features or debugging unexpected behaviors.
Architecture
I have mocked up the basic structure of proposed changes: https://github.com/damirka/leo/blob/leo-ref/leo
In detail:
Compatibility
This is only reorganization, not a refactoring. Every command can be simply placed into new Cmd wrappers with its arguments specified. So no functionality is going to be lost in the process. You can run examples from the repo and see that they work (1) and contain the same code as current Leo CLI.
StructOpt is Clap but better on definitions.
Estimates
Should take about 2 days to copy-paste commands and do some cosmetics and docs.
What it brings
It also creates space for future optimizations such as putting manifest into context, having common handlers and structures for APIs and makes code more readable and upgradable.
The text was updated successfully, but these errors were encountered: