26 lines
578 B
Rust
26 lines
578 B
Rust
use inventur_db::*;
|
|
use std::env::args;
|
|
|
|
fn main() {
|
|
let tblid = args()
|
|
.nth(1)
|
|
.expect("Usage: move_entry <tblid> <rowpos> <newpos>.")
|
|
.parse::<i32>()
|
|
.expect("Expected a number.");
|
|
|
|
let rowpos = args()
|
|
.nth(2)
|
|
.expect("Usage: move_entry <tblid> <rowpos> <newpos>.")
|
|
.parse::<i32>()
|
|
.expect("Expected a number.");
|
|
|
|
let newpos = args()
|
|
.nth(3)
|
|
.expect("Usage: move_entry <tblid> <rowpos> <newpos>.")
|
|
.parse::<i32>()
|
|
.expect("Expected a number.");
|
|
|
|
println!("{:?}", jrentries::move_jrentry(&mut establish_connection(), tblid, rowpos, newpos));
|
|
|
|
}
|