From 23ba22385fec1faa5d823bc6021e68555d12fd6d Mon Sep 17 00:00:00 2001 From: Jokler Date: Mon, 22 Jun 2020 02:41:23 +0200 Subject: Add scriptisto rust template --- .config/scriptisto/templates/rust.rs | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .config/scriptisto/templates/rust.rs (limited to '.config') diff --git a/.config/scriptisto/templates/rust.rs b/.config/scriptisto/templates/rust.rs new file mode 100644 index 0000000..3d3be95 --- /dev/null +++ b/.config/scriptisto/templates/rust.rs @@ -0,0 +1,40 @@ +#!/usr/bin/env scriptisto + +// scriptisto-begin +// script_src: src/main.rs +// build_cmd: cargo build --release && strip ./target/release/script +// target_bin: ./target/release/script +// files: +// - path: Cargo.toml +// content: | +// package = { name = "script", version = "0.1.0", edition = "2018"} +// [dependencies] +// scripttools = { path = "/home/jokler/rust/scripttools" } +// structopt="*" +// cmd_lib = "*" +// atty = "*" +// scriptisto-end + +use structopt::StructOpt; +use cmd_lib::*; +use scripttools::*; + +#[derive(Debug, StructOpt)] +#[structopt(name = "script", about = "A script.")] +struct Opt { + /// Example input + #[structopt(short, long)] + input: Option, +} + +fn main() { + let opt = Opt::from_args(); + if let Err(e) = run(opt) { + eprintln!("{}", e); + } +} + +fn run(opt: Opt) -> Result<()> { +} + +// vim: filetype=rust \ No newline at end of file -- cgit v1.2.3-70-g09d2