Skip to content

Commit

Permalink
help updated + arg parsing changed again
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiserthe13th committed Oct 17, 2021
1 parent c33cdd3 commit 8dfc1a9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tr-lang"
version = "0.1.1"
version = "0.1.2"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fn main() {
let cont = cont;
let mut lexer = Lexer::new(cont);
let lexed = lexer.lex();
if util::item_in_vec(&["--debug".to_string(), "-d".to_string()], &args) {
if util::item_in_vec(&["--show-lex-result".to_string(), "-l".to_string()], &args) {
println!("{:#?}", lexed);
}
}
4 changes: 2 additions & 2 deletions src/store.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pub const VERSION: &str = "0.1.1";
pub const RELEASE: &str = "16 October 2021";
pub const VERSION: &str = "0.1.2";
pub const RELEASE: &str = "17 October 2021";
9 changes: 5 additions & 4 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ pub fn print_help(exit_code: i32, prog_name: String) -> ! {
println!(" {} <FILE> [options]", prog_name);
println!("");
println!("OPTIONS:");
println!(" -h --help print help and exit");
println!(" -v --version print version and exit");
println!(" -h --help print help and exit");
println!(" -v --version print version and exit");
println!(" -l --show-lex-result show the lexer output after lexing");
crate::exit(exit_code);
}

pub fn print_version(prog_name: String) -> ! {
println!("{} cersion {} released at {}", prog_name, VERSION, RELEASE);
println!("{} version {} released at {}", prog_name, VERSION, RELEASE);
crate::exit(0);
}
}

0 comments on commit 8dfc1a9

Please sign in to comment.