Skip to content

Commit 0fca9df

Browse files
authored
Enhance dctl list command, add running status for each project. (#13)
1 parent 9342f9d commit 0fca9df

File tree

15 files changed

+1001
-304
lines changed

15 files changed

+1001
-304
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## Next Release
1+
## 0.4.0 (2022-10-14)
22

3-
*
3+
* Add running status in the dctl command list.
4+
* Refactoring the code, add more tests.
45

56
## 0.3.0 (2022-10-12)
67

cli/Cargo.lock

Lines changed: 192 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
[package]
22
name = "dctl"
3-
version = "0.3.0"
3+
version = "0.4.0"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
99
eyre = { version = "0.6.8" }
10-
clap = { version = "4.0.11", features = ["derive", "cargo"] }
10+
clap = { version = "4.0.14", features = ["derive", "cargo"] }
1111
toml = { version = "0.5.9" }
1212
dotenv = { version = "0.15.0" }
13-
serde = { version = "1.0.145", features = ["derive" ] }
13+
serde = { version = "1.0.145", features = ["derive"] }
14+
serde_json = "1.0.86"
1415
shellexpand = { version = "2.1.2" }
15-
tabled = { version = "0.9.0" }
16+
tabled = { version = "0.9.0" }
17+
mockall = { version = "0.11.2" }

cli/src/command.rs

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,7 @@
1-
use std::{ffi::OsStr, process::Command};
2-
3-
pub(crate) fn builder(bin_command: String, sorted_args: Vec<&OsStr>) -> Command {
4-
// Build a command with the given arguments
5-
let mut cmd = Command::new(bin_command);
6-
7-
sorted_args.into_iter().for_each(|arg| {
8-
cmd.arg(arg);
9-
});
10-
11-
cmd
12-
}
1+
pub mod docker;
2+
pub mod system;
133

144
#[cfg(test)]
15-
mod tests {
16-
use super::*;
17-
18-
#[test]
19-
fn test_builder() {
20-
let bin_command = "ls".to_string();
21-
let args = vec![OsStr::new("-l"), OsStr::new("-a")];
22-
23-
let cmd = builder(bin_command.to_owned(), args.to_owned());
24-
let cmd_args: Vec<&OsStr> = cmd.get_args().collect();
25-
26-
assert_eq!(cmd.get_program(), OsStr::new(&bin_command));
27-
assert_eq!(cmd_args, args);
28-
}
29-
}
5+
pub mod docker_tests;
6+
#[cfg(test)]
7+
pub mod system_tests;

0 commit comments

Comments
 (0)