Skip to content

Commit

Permalink
Add REPL
Browse files Browse the repository at this point in the history
  • Loading branch information
hahnavi committed Dec 10, 2024
1 parent c2641fb commit 267a786
Show file tree
Hide file tree
Showing 4 changed files with 254 additions and 47 deletions.
110 changes: 110 additions & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[package]
name = "komandan"
version = "0.1.0"
authors = ["Abdul Munif Hanafi"]
license = "MIT"
edition = "2021"

[dependencies]
Expand All @@ -9,5 +11,6 @@ clap = { version = "4.5.21", features = ["derive"] }
mlua = { version = "0.10.1", features = ["anyhow", "async", "luajit", "macros", "vendored"] }
rand = "0.8.5"
regex = "1.11.1"
rustyline = "15.0.0"
ssh2 = "0.9.4"
tokio = { version = "1.42.0", features = ["io-std", "macros", "rt"] }
18 changes: 15 additions & 3 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,25 @@ use clap::Parser;

/// Your army commander
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
#[command(about, long_about = None)]
pub struct Args {
/// Main file location
#[arg(default_value = "main.lua")]
pub main_file: String,
#[arg()]
pub main_file: Option<String>,

/// Execute string 'chunk'
#[arg(short='e', )]
pub chunk: Option<String>,

/// Enter interactive mode after executing 'script'.
#[arg(short, long)]
pub interactive: bool,

/// Print debug messages
#[arg(short, long)]
pub verbose: bool,

/// Print version information
#[arg(short='V', long)]
pub version: bool,
}
Loading

0 comments on commit 267a786

Please sign in to comment.