Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
chore: print help when no arguments provided (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabnock01 committed Jun 16, 2023
1 parent dd96879 commit 25f04d9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion huff_cli/src/huffc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub(crate) fn get_input(prompt: &str) -> String {

fn main() {
// Into App
let app: App = Huff::into_app();
let mut app: App = Huff::into_app();

// Parse the command line arguments
let mut cli = Huff::parse();
Expand All @@ -142,6 +142,13 @@ fn main() {
Compiler::init_tracing_subscriber(Some(vec![tracing::Level::DEBUG.into()]));
}

// Check if no argument is provided
if cli.path.is_none() {
// Print help and exit
app.print_help().unwrap();
return
}

// Create compiler from the Huff Args
let sources: Arc<Vec<String>> = match cli.get_inputs() {
Ok(s) => Arc::new(s),
Expand Down

0 comments on commit 25f04d9

Please sign in to comment.