use url::Url;
pub mod grpc {
tonic::include_proto!("asciidoctor");
}
#[derive(argh::FromArgs, Debug)]
pub struct Args {
#[argh(option, short = 'r')]
pub extensions: Vec<String>,
#[argh(option, short = 'b', default = "\"html5\".to_string()")]
pub backend: String,
#[argh(option, short = 'a')]
pub attributes: Vec<String>,
#[argh(switch, short = 's')]
pub no_header_footer: bool,
#[argh(option, long = "address", default = "default_server_address()")]
pub server_address: url::Url,
#[argh(positional, greedy)]
pub input: Vec<String>,
}
fn default_server_address() -> Url {
Url::parse(
format!(
"unix:{}",
std::env::current_dir()
.unwrap()
.join("../.asciidoctor-server.sock")
.display()
)
.as_str(),
)
.unwrap()
}