This repository has been archived by the owner on Dec 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Runtime commmand line interface
Closes #357, closes #589. - Moved logger initialize/release declaration to `common/logger.h` to have better control of logger functions (we can know what logger could be enabled by inspecting `logger.h`). - Wrapped the logger initialize/release functions so we can enable/disable verbose mode at ease in runtime-cli utility. - Implement runtime command line utility The runtime command line utility is a separated from the main thread. The commands are maintained by several states defined in `runtime_cli.c`. We also have a static global pointer indicating which state we are at now. Take the states in `runtime_cli.c` for example, we are at `start_state` in the beginning. Everytime we need to `handle_commands`, we will extract one more string (separated by spaces), and find if the command names in current state matches the string. Upon matching, we will then determine if current command needs more subcommand. If so, the command type would be `CMD_STATE` and `ta_state_ptr` would be assigned to `next_state`. On the other hand, if current command reaches the end and is expecting zero or more parameters, the type would be `CMD_LAST`, and will execute the specified function `fn`. If no command names match, the program will simply print help messages according to the current state `ta_state_ptr` points to. Runtime-cli can be enabled by adding `--runtime_cli` argument.
- Loading branch information
Showing
42 changed files
with
783 additions
and
347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.