sbatch_rs/sbatch_option/
display.rs

1//! Display implementation for `SbatchOption`
2
3use super::SbatchOption;
4
5impl std::fmt::Display for SbatchOption {
6    /// The `Display` trait is implemented for `SbatchOption` to allow the `SbatchOption` to be converted into a string for display purposes.
7    ///
8    /// # Example
9    ///
10    /// ```
11    /// use sbatch_rs::SbatchOption;
12    ///
13    /// let option = SbatchOption::JobName("test".to_string());
14    /// assert_eq!(option.to_string(), "--job-name=test");
15    /// ```
16    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17        match self {
18            SbatchOption::Account(value) => write!(f, "--account={}", value),
19            SbatchOption::AcctgFreq(value) => write!(f, "--acctg-freq={}", value),
20            SbatchOption::Array(value) => write!(f, "--array={}", value),
21            SbatchOption::Batch(value) => write!(f, "--batch={}", value),
22            SbatchOption::Bb(value) => write!(f, "--bb={}", value),
23            SbatchOption::Bbf(value) => write!(f, "--bbf={}", value),
24            SbatchOption::Begin(value) => write!(f, "--begin={}", value),
25            SbatchOption::Chdir(value) => write!(f, "--chdir={}", value),
26            SbatchOption::ClusterConstraint(value) => write!(f, "--cluster-constraint={}", value),
27            SbatchOption::Clusters(value) => write!(f, "--clusters={}", value),
28            SbatchOption::Comment(value) => write!(f, "--comment={}", value),
29            SbatchOption::Constraint(value) => write!(f, "--constraint={}", value),
30            SbatchOption::Container(value) => write!(f, "--container={}", value),
31            SbatchOption::ContainerID(value) => write!(f, "--container-id={}", value),
32            SbatchOption::Contiguous => write!(f, "--contiguous"),
33            SbatchOption::CoreSpec(value) => write!(f, "--core-spec={}", value),
34            SbatchOption::CoresPerSocket(value) => write!(f, "--cores-per-socket={}", value),
35            SbatchOption::CPUFreq(value) => write!(f, "--cpu-freq={}", value),
36            SbatchOption::CPUsPerGPU(value) => write!(f, "--cpus-per-gpu={}", value),
37            SbatchOption::CPUsPerTask(value) => write!(f, "--cpus-per-task={}", value),
38            SbatchOption::Deadline(value) => write!(f, "--deadline={}", value),
39            SbatchOption::DelayBoot(value) => write!(f, "--delay-boot={}", value),
40            SbatchOption::Dependency(value) => write!(f, "--dependency={}", value),
41            SbatchOption::Distribution(value) => write!(f, "--distribution={}", value),
42            SbatchOption::Error(value) => write!(f, "--error={}", value),
43            SbatchOption::Exclude(value) => write!(f, "--exclude={}", value),
44            SbatchOption::Exclusive(Some(value)) => write!(f, "--exclusive={}", value),
45            SbatchOption::Exclusive(None) => write!(f, "--exclusive"),
46            SbatchOption::Export(value) => write!(f, "--export={}", value),
47            SbatchOption::ExportFile(value) => write!(f, "--export-file={}", value),
48            SbatchOption::Extra(value) => write!(f, "--extra={}", value),
49            SbatchOption::ExtraNodeInfo(value) => write!(f, "--extra-node-info={}", value),
50            SbatchOption::GetUserEnv(Some(value)) => write!(f, "--get-user-env={}", value),
51            SbatchOption::GetUserEnv(None) => write!(f, "--get-user-env"),
52            SbatchOption::GID(value) => write!(f, "--gid={}", value),
53            SbatchOption::GPUBind(value) => write!(f, "--gpu-bind={}", value),
54            SbatchOption::GPUFreq(value) => write!(f, "--gpu-freq={}", value),
55            SbatchOption::GPUs(value) => write!(f, "--gpus={}", value),
56            SbatchOption::GPUsPerNode(value) => write!(f, "--gpus-per-node={}", value),
57            SbatchOption::GPUsPerSocket(value) => write!(f, "--gpus-per-socket={}", value),
58            SbatchOption::GPUsPerTask(value) => write!(f, "--gpus-per-task={}", value),
59            SbatchOption::Gres(value) => write!(f, "--gres={}", value),
60            SbatchOption::GresFlags(value) => write!(f, "--gres-flags={}", value),
61            SbatchOption::Help => write!(f, "--help"),
62            SbatchOption::Hint(value) => write!(f, "--hint={}", value),
63            SbatchOption::Hold => write!(f, "--hold"),
64            SbatchOption::IgnorePbs => write!(f, "--ignore-pbs"),
65            SbatchOption::Input(value) => write!(f, "--input={}", value),
66            SbatchOption::JobName(value) => write!(f, "--job-name={}", value),
67            SbatchOption::KillOnInvalidDep(value) => write!(f, "--kill-on-invalid-dep={}", value),
68            SbatchOption::Licenses(value) => write!(f, "--licenses={}", value),
69            SbatchOption::MailType(value) => write!(f, "--mail-type={}", value),
70            SbatchOption::MailUser(value) => write!(f, "--mail-user={}", value),
71            SbatchOption::McsLabel(value) => write!(f, "--mcs-label={}", value),
72            SbatchOption::Mem(value) => write!(f, "--mem={}", value),
73            SbatchOption::MemBind(value) => write!(f, "--mem-bind={}", value),
74            SbatchOption::MemPerCPU(value) => write!(f, "--mem-per-cpu={}", value),
75            SbatchOption::MemPerGPU(value) => write!(f, "--mem-per-gpu={}", value),
76            SbatchOption::MinCPUs(value) => write!(f, "--min-cpus={}", value),
77            SbatchOption::Network(value) => write!(f, "--network={}", value),
78            SbatchOption::Nice(Some(value)) => write!(f, "--nice={}", value),
79            SbatchOption::Nice(None) => write!(f, "--nice"),
80            SbatchOption::NoKill(Some(value)) => write!(f, "--no-kill={}", value),
81            SbatchOption::NoKill(None) => write!(f, "--no-kill"),
82            SbatchOption::NoRequeue => write!(f, "--no-requeue"),
83            SbatchOption::NodeFile(value) => write!(f, "--nodefile={}", value),
84            SbatchOption::NodeList(value) => write!(f, "--nodelist={}", value),
85            SbatchOption::Nodes(value) => write!(f, "--nodes={}", value),
86            SbatchOption::NTasks(value) => write!(f, "--ntasks={}", value),
87            SbatchOption::NTasksPerCore(value) => write!(f, "--ntasks-per-core={}", value),
88            SbatchOption::NTasksPerGPU(value) => write!(f, "--ntasks-per-gpu={}", value),
89            SbatchOption::NTasksPerNode(value) => write!(f, "--ntasks-per-node={}", value),
90            SbatchOption::NTasksPerSocket(value) => write!(f, "--ntasks-per-socket={}", value),
91            SbatchOption::OOMKillStep(Some(value)) => write!(f, "--oom-kill-step={}", value),
92            SbatchOption::OOMKillStep(None) => write!(f, "--oom-kill-step"),
93            SbatchOption::OpenMode(value) => write!(f, "--open-mode={}", value),
94            SbatchOption::Output(value) => write!(f, "--output={}", value),
95            SbatchOption::Overcommit => write!(f, "--overcommit"),
96            SbatchOption::Oversubscribe => write!(f, "--oversubscribe"),
97            SbatchOption::Parsable => write!(f, "--parsable"),
98            SbatchOption::Partition(value) => write!(f, "--partition={}", value),
99            SbatchOption::Prefer(value) => write!(f, "--prefer={}", value),
100            SbatchOption::Priority(value) => write!(f, "--priority={}", value),
101            SbatchOption::Profile(value) => write!(f, "--profile={}", value),
102            SbatchOption::Propagate(Some(value)) => write!(f, "--propagate={}", value),
103            SbatchOption::Propagate(None) => write!(f, "--propagate"),
104            SbatchOption::Qos(value) => write!(f, "--qos={}", value),
105            SbatchOption::Quiet => write!(f, "--quiet"),
106            SbatchOption::Reboot => write!(f, "--reboot"),
107            SbatchOption::Requeue => write!(f, "--requeue"),
108            SbatchOption::Reservation(value) => write!(f, "--reservation={}", value),
109            SbatchOption::ResvPorts(Some(value)) => write!(f, "--resv-ports={}", value),
110            SbatchOption::ResvPorts(None) => write!(f, "--resv-ports"),
111            SbatchOption::Segment(value) => write!(f, "--segment={}", value),
112            SbatchOption::Signal(value) => write!(f, "--signal={}", value),
113            SbatchOption::SocketsPerNode(value) => write!(f, "--sockets-per-node={}", value),
114            SbatchOption::SpreadJob => write!(f, "--spread-job"),
115            SbatchOption::Stepmgr => write!(f, "--stepmgr"),
116            SbatchOption::Switches(value) => write!(f, "--switches={}", value),
117            SbatchOption::TestOnly => write!(f, "--test-only"),
118            SbatchOption::ThreadSpec(value) => write!(f, "--thread-spec={}", value),
119            SbatchOption::ThreadsPerCore(value) => write!(f, "--threads-per-core={}", value),
120            SbatchOption::Time(value) => write!(f, "--time={}", value),
121            SbatchOption::TimeMin(value) => write!(f, "--time-min={}", value),
122            SbatchOption::Tmp(value) => write!(f, "--tmp={}", value),
123            SbatchOption::TresBind(value) => write!(f, "--tres-bind={}", value),
124            SbatchOption::TresPerTask(value) => write!(f, "--tres-per-task={}", value),
125            SbatchOption::UID(value) => write!(f, "--uid={}", value),
126            SbatchOption::Usage => write!(f, "--usage"),
127            SbatchOption::UseMinNodes => write!(f, "--use-min-nodes"),
128            SbatchOption::Verbose => write!(f, "--verbose"),
129            SbatchOption::Version => write!(f, "--version"),
130            SbatchOption::Wait => write!(f, "--wait"),
131            SbatchOption::WaitAllNodes(value) => write!(f, "--wait-all-nodes={}", value),
132            SbatchOption::WCKey(value) => write!(f, "--wckey={}", value),
133            SbatchOption::Wrap(value) => write!(f, r#"--wrap="{}""#, value),
134        }
135    }
136}