-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(libmake): 🎨 Enhance arg parsing, validation, error handling …
…and dep updates Improve argument parsing using a macro, handle errors gracefully, and enhance validation logic for manual generation parameters.
- Loading branch information
1 parent
11eeae0
commit c42d4ad
Showing
5 changed files
with
100 additions
and
75 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright notice and licensing information. | ||
// These lines indicate the copyright of the software and its licensing terms. | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT indicates dual licensing under Apache 2.0 or MIT licenses. | ||
// Copyright © 2024 LibMake. All rights reserved. | ||
|
||
/// Macro to simplify the match logic for file generation. | ||
#[macro_export] | ||
macro_rules! generate_file { | ||
($file_type:expr, $value:expr, $generator:expr) => { | ||
if !$value.trim().is_empty() { | ||
if let Err(err) = $generator($value) { | ||
eprintln!("Error generating {} file: {}", $file_type, err); | ||
} | ||
} | ||
}; | ||
} | ||
|
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