Skip to content

Commit

Permalink
src: main: Use the Cli parser in the actual program
Browse files Browse the repository at this point in the history
Make actual use of the `Cli` parser. Notice that the actual app code
will only execute if neither `--version` nor `--help` is used

Closes: #17

[Maintainer edits]
- Added commentary to explain why we use `_args` in the arg parsing
- Added "Closes" tag to commit message

Signed-off-by: OJarrisonn <j.h.m.t.v.10@gmail.com>
Reviewed-by: David Tadokoro <davidbtadokoro@usp.br>
Signed-off-by: David Tadokoro <davidbtadokoro@usp.br>
  • Loading branch information
OJarrisonn authored and davidbtadokoro committed Aug 8, 2024
1 parent d96f211 commit 7694583
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use app::{
App, CurrentScreen
};
use clap::Parser;
use cli::Cli;
use ratatui::{
backend::Backend,
crossterm::event::{
Expand All @@ -11,10 +13,14 @@ use ratatui::{
use ui::draw_ui;

mod app;
mod cli;
mod ui;
mod utils;

fn main() -> color_eyre::Result<()> {
// We use an unused var because we only parse for `-h|--help` and `-V|--version`
let _args = Cli::parse();

utils::install_hooks()?;
let mut terminal = utils::init()?;
let mut app = App::new();
Expand Down

0 comments on commit 7694583

Please sign in to comment.