File: basic_ro.rs

package info (click to toggle)
rust-pleaser 0.5.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 700 kB
  • sloc: makefile: 10
file content (20 lines) | stat: -rw-r--r-- 562 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use chrono::NaiveDate;
use pleaser::*;

pub fn basic_ro(name: &str, target: &str) -> RunOptions {
    let mut ro = RunOptions::new();
    ro.date = NaiveDate::from_ymd(2020, 1, 1).and_hms(0, 0, 0);
    ro.name = name.to_string();
    ro.target = target.to_string();
    ro.acl_type = Acltype::Run;
    ro.hostname = "localhost".to_string();

    ro
}

pub fn basic_cmd(ro: &mut RunOptions, cmd: &str) {
    ro.new_args = cmd.split_whitespace().map(|s| s.to_string()).collect();
    if ro.new_args.len() == 0 {
        ro.new_args = vec!["".to_string()];
    }
}