Skip to content

Commit

Permalink
Fixed CLI version
Browse files Browse the repository at this point in the history
  • Loading branch information
OJarrisonn committed Jan 24, 2024
1 parent 5608892 commit c50a258
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion vaca/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description = "Vaca programming language interpreter"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = { version = "4.4.18", features = ["derive"] }
clap = { version = "4.4.18", features = ["derive", "cargo"] }
homedir = "0.2.1"
envconfig = "0.10.0"

Expand Down
2 changes: 1 addition & 1 deletion vaca/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub enum Commands {
Repl,
/// Runs a .vaca or .casco file
Run(RunArgs),
/// Builds a .vaca file an generates a .casci binary file
/// Builds a .vaca file an generates a .casco binary file
Build(BuildArgs)
}

Expand Down
5 changes: 2 additions & 3 deletions vaca/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use envconfig::Envconfig;
use vaca_repl::{Repl, Settings};
use vaca_vm;

const VERSION: &str = "0.5.6";
fn main() -> Result<(), Box<dyn std::error::Error>> {
let cli = Cli::parse();

Expand All @@ -30,11 +29,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {

let res = match cli.command {
Some(cmd) => match cmd {
cli::Commands::Repl => repl(VERSION),
cli::Commands::Repl => repl(clap::crate_version!()),
cli::Commands::Run(RunArgs { file: filename }) => vaca_vm::run(filename),
cli::Commands::Build(BuildArgs { input, output}) => vaca_build::build(input, output)
},
None => repl(VERSION)
None => repl(clap::crate_version!())
};

match res {
Expand Down

0 comments on commit c50a258

Please sign in to comment.