use run instead of compile, it describes an interpreter better
This commit is contained in:
parent
32e5e8a41a
commit
175f672dd6
2 changed files with 4 additions and 4 deletions
|
@ -14,7 +14,7 @@ pub struct Cli {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Args, Clone)]
|
#[derive(Args, Clone)]
|
||||||
pub struct CompileConfig {
|
pub struct RunConfig {
|
||||||
/// Path to Lox source file.
|
/// Path to Lox source file.
|
||||||
#[arg(short, long)]
|
#[arg(short, long)]
|
||||||
pub source: PathBuf,
|
pub source: PathBuf,
|
||||||
|
@ -22,8 +22,8 @@ pub struct CompileConfig {
|
||||||
|
|
||||||
#[derive(Subcommand)]
|
#[derive(Subcommand)]
|
||||||
pub enum Commands {
|
pub enum Commands {
|
||||||
/// Compile a Lox source file.
|
/// Run a Lox source file.
|
||||||
Compile(CompileConfig),
|
Run(RunConfig),
|
||||||
/// Run a Lox REPL.
|
/// Run a Lox REPL.
|
||||||
Repl,
|
Repl,
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ fn main() {
|
||||||
let cli = Cli::parse();
|
let cli = Cli::parse();
|
||||||
|
|
||||||
match &cli.command {
|
match &cli.command {
|
||||||
Commands::Compile(compile_config) => {
|
Commands::Run(compile_config) => {
|
||||||
if !&compile_config.source.exists() {
|
if !&compile_config.source.exists() {
|
||||||
error!(
|
error!(
|
||||||
"{} does not exist",
|
"{} does not exist",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue