common: Add helper function for running logging command
This commit is contained in:
parent
c078a13c8e
commit
3938e5c0c8
1 changed files with 16 additions and 0 deletions
|
@ -7,6 +7,13 @@ pub struct OpenBinaryArgs {
|
|||
pub resource_shortcut: i8,
|
||||
}
|
||||
|
||||
pub struct LogBinaryArgs {
|
||||
pub time: String,
|
||||
pub method: String,
|
||||
pub identifier: String,
|
||||
pub resource: String,
|
||||
}
|
||||
|
||||
pub fn run_bin(bin: Binary) -> BinaryResult {
|
||||
use std::{
|
||||
io::Read,
|
||||
|
@ -36,3 +43,12 @@ pub fn run_open(args: OpenBinaryArgs, bin: Binary) -> BinaryResult {
|
|||
auth_bin.push(args.resource_shortcut.to_string());
|
||||
run_bin(auth_bin)
|
||||
}
|
||||
|
||||
pub fn run_log(args: LogBinaryArgs, bin: Binary) -> BinaryResult {
|
||||
let mut auth_bin = bin.clone();
|
||||
auth_bin.push(args.time.clone());
|
||||
auth_bin.push(args.method.clone());
|
||||
auth_bin.push(args.identifier.clone());
|
||||
auth_bin.push(args.resource.clone());
|
||||
run_bin(auth_bin)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue