-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
69 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,10 +14,10 @@ pub mod process_html{ | |
let mut tmp=String::from(scml_string); | ||
|
||
//loop through 20 times to be sure all values of in are correctly replaced | ||
for _i in 1..20{ | ||
for _i in 1..50{ | ||
for (key, value) in scml_hash{ | ||
let key=format!("in[{}]", key); | ||
tmp=tmp.replace(&key, value); | ||
tmp=tmp.replace(&key, value); | ||
|
||
} | ||
|
||
|
@@ -91,8 +91,15 @@ pub mod process_html{ | |
impl Config { | ||
pub fn new(mut value: std::env::Args) -> Result<Config, &'static str> { | ||
if value.len() < 3 { | ||
return Err("at least 2 arguments are expected"); | ||
} else { | ||
println!(" | ||
Inavlid number of arguments parsed | ||
SCML CLI options | ||
Options:\n\tscml scml_path new_file_name => Transpile SCML and create HTML and JS | ||
Author: Oragbakosi Valentine <email: [email protected]> | ||
"); | ||
return Err(""); | ||
}else { | ||
value.next(); | ||
let filename = match value.next() { | ||
Some(arg) => arg, | ||
|
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