executeCLI runs the root command, handling any errors that occur during execution. It serves as the main entry point for the CLI application.
()
| 128 | // executeCLI runs the root command, handling any errors that occur during execution. |
| 129 | // It serves as the main entry point for the CLI application. |
| 130 | func (w LedgerForge) executeCLI() { |
| 131 | if err := w.cmd.Execute(); err != nil { |
| 132 | fmt.Fprintln(os.Stderr, err) // Print any errors that occur |
| 133 | os.Exit(1) // Exit the program with an error status |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | // main is the main function and the entry point for the application. |
| 138 | // It recovers from any panic, initializes the CLI, and executes it. |