Initialize project structure with basic CLI setup

This commit is contained in:
Overlord committed 2026-03-02 20:13:38 +01:00
1 parent e464dae53d
commit e8cf10eee3
6 files changed
+62

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
.idea/
.vscode/
target/
Cargo.lock
*.pdb
**/*.rs.bk
+12
View File
@@ -0,0 +1,12 @@
[package]
name = "pmp"
description = """\
PHP Macro Pre-processor (PMP) \
A php lexer, parser and macro pre-processor written in Rust. \
"""
version = "0.1.0-alpha"
edition = "2024"
[dependencies]
clap = { version = "^4", features = ["derive"] }
+29
View File
@@ -0,0 +1,29 @@
use clap::Parser;
use std::{
ffi::OsStr,
path::PathBuf
};
#[derive(Parser, Debug)]
#[command(name = "pmp", about, version)]
pub struct Args {
#[arg(long)]
php: Option<PathBuf>,
#[arg(long, short = 'd', hide = true)]
debug: bool,
#[arg(long, short = 'v')]
verbose: bool,
#[arg(default_value_os = OsStr::new("."))]
files: Vec<PathBuf>,
#[arg(last = true)]
passthrough: Vec<String>,
}
impl Args
{
pub fn parse() -> Self {
<Self as Parser>::parse()
}
}
+3
View File
@@ -0,0 +1,3 @@
pub mod flags;
pub use flags::Args;
+1
View File
@@ -0,0 +1 @@
pub mod cli;
+8
View File
@@ -0,0 +1,8 @@
use pmp::{ cli::Args };
fn main()
{
let args = Args::parse();
println!("{:?}", args);
}