Skip to content

Commit f4b4805

Browse files
committed
Bump to 0.0.2, remove unnecessary command logic
1 parent 854fec4 commit f4b4805

File tree

3 files changed

+17
-32
lines changed

3 files changed

+17
-32
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "arpx"
33
description = "Automate and relate multiple processes."
4-
version = "0.0.1"
4+
version = "0.0.2"
55
license = "MIT"
66
readme = "README.md"
77
keywords = ["automation", "process", "concurrency", "multiplexer"]

src/commands/mod.rs

+15-30
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,30 @@ pub mod run;
77
pub struct Command {
88
pub profile: Profile,
99
pub daemon_mode: bool,
10-
pub pid_to_kill: String,
1110
pub processes_to_run: Vec<String>,
1211
pub verbosity: String,
1312
}
1413

1514
pub fn get_command(matches: ArgMatches) -> Command {
16-
let mut cmd_profile: Profile = Profile::new();
17-
let mut cmd_daemon: bool = false;
18-
let mut cmd_kill: String = String::new();
19-
let mut cmd_processes: Vec<String> = Vec::new();
15+
let file: String = matches.value_of("file").unwrap_or("arpx.yaml").to_string();
16+
let cmd_profile = match get_profile(file) {
17+
Ok(profile) => profile,
18+
Err(error) => panic!(error),
19+
};
2020

21-
if matches.is_present("ls") {
22-
println!("NOTE: Processes cannot be listed. Feature not fully implemented yet.");
21+
let mut cmd_processes: Vec<String> = Vec::new();
22+
if let Some(ref process) = matches.value_of("process") {
23+
cmd_processes.push(process.to_string());
2324
} else {
24-
let file: String = matches.value_of("file").unwrap_or("arpx.yaml").to_string();
25-
26-
cmd_profile = match get_profile(file) {
27-
Ok(profile) => profile,
28-
Err(error) => panic!(error),
29-
};
30-
31-
if matches.is_present("daemon") {
32-
cmd_daemon = true;
33-
println!("NOTE: Daemon mode not invoked. Feature not fully implemented yet.");
34-
}
35-
36-
if let Some(pid) = matches.value_of("kill") {
37-
cmd_kill = pid.to_string();
38-
println!("NOTE: Process cannot be killed. Feature not fully implemented yet.");
25+
for process in cmd_profile.processes.iter() {
26+
cmd_processes.push(process.name[..].to_string());
3927
}
28+
}
4029

41-
if let Some(ref process) = matches.value_of("process") {
42-
cmd_processes.push(process.to_string());
43-
} else {
44-
for process in cmd_profile.processes.iter() {
45-
cmd_processes.push(process.name[..].to_string());
46-
}
47-
}
30+
let mut cmd_daemon: bool = false;
31+
if matches.is_present("daemon") {
32+
cmd_daemon = true;
33+
println!("NOTE: Daemon mode not invoked. Feature not fully implemented yet.");
4834
}
4935

5036
let cmd_verbosity = match matches.occurrences_of("v") {
@@ -61,7 +47,6 @@ pub fn get_command(matches: ArgMatches) -> Command {
6147
Command {
6248
profile: cmd_profile,
6349
daemon_mode: cmd_daemon,
64-
pid_to_kill: cmd_kill,
6550
processes_to_run: cmd_processes,
6651
verbosity: cmd_verbosity,
6752
}

0 commit comments

Comments
 (0)