Skip to content

Commit

Permalink
--help
Browse files Browse the repository at this point in the history
  • Loading branch information
SKyletoft committed Apr 18, 2021
1 parent 2b2b0ff commit 07ce77b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cflisp-cli/src/help.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Usage cflisp [options] file...
Options:

--help Print this page

-x Prints numbers as hex instead
-c Disables comments (variable names mostly)
-p Prints the parsed tree structure of the program
-P Prints the parsed tree after structs have been simplified down to native types and after -O2 IR optimisations have been performed
-t Disables type checking
-s Prints the compiled code to stdout instead of a file
-a Calls qaflisp directly. Requires qaflisp to be on $PATH. Probably doesn't work on Windows
-o Sets the name of the output file (following argument)
-g Adds debug info. Disables removal of unused names and adds `ORG $20` to the top for easier digiflisp debugging
-O (/O1/O2) Enables optimisations. (If a level is specified it needs to be its own flag)
-k Disables interrupts after main has exited
10 changes: 10 additions & 0 deletions cflisp-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ const QAFLISP: &str = "\\qaflisp.exe";
//Yes, this is a horrible mess
fn main() {
let args = env::args().skip(1).collect::<Vec<_>>();

if args
.iter()
.map(String::as_str)
.any(|s| s == "--help" || s == "-help")
{
println!(include_str!("help.txt"));
process::exit(0);
}

let flags = args.iter().collect::<Flags>();
let files = args
.iter()
Expand Down

0 comments on commit 07ce77b

Please sign in to comment.