Skip to content

Commit

Permalink
Add proper process titles
Browse files Browse the repository at this point in the history
Signed-off-by: Elizabeth Myers <[email protected]>
  • Loading branch information
Elizafox committed Mar 18, 2024
1 parent 0a63562 commit 15acef3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cli/subcommands/adduser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ impl CliSubcommand for AddUserSubcommand {
type PromptUserData = AddUserData;
type CommandData = UsernameArgument;

fn proc_title() -> String {
"shadyurl-rust [add-user]".to_string()
}

fn prompt_user() -> Result<Self::PromptUserData, Self::Error> {
let mut password = prompt_password("Password:")?;
if password != prompt_password("Repeat password:")? {
Expand Down
4 changes: 4 additions & 0 deletions src/cli/subcommands/changepassword.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ impl CliSubcommand for ChangePasswordSubcommand {
type PromptUserData = ChangePasswordData;
type CommandData = UsernameArgument;

fn proc_title() -> String {
"shadyurl-rust [change-password]".to_string()
}

fn prompt_user() -> Result<Self::PromptUserData, Self::Error> {
let mut password = prompt_password("Password:")?;
if password != prompt_password("Repeat password:")? {
Expand Down
4 changes: 4 additions & 0 deletions src/cli/subcommands/deleteuser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ impl CliSubcommand for DeleteUserSubcommand {
type PromptUserData = ();
type CommandData = UsernameArgument;

fn proc_title() -> String {
"shadyurl-rust [delete-user]".to_string()
}

fn prompt_user() -> Result<Self::PromptUserData, Self::Error> {
let mut response = String::new();
loop {
Expand Down
4 changes: 4 additions & 0 deletions src/cli/subcommands/generatekeys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ impl CliSubcommand for GenerateKeysSubcommand {
type PromptUserData = ();
type CommandData = ();

fn proc_title() -> String {
"shadyurl-rust [generate-keys]".to_string()
}

fn prompt_user() -> Result<Self::PromptUserData, Self::Error> {
Ok(())
}
Expand Down
4 changes: 4 additions & 0 deletions src/cli/subcommands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ impl CliSubcommand for RunSubcommand {
type PromptUserData = ();
type CommandData = ();

fn proc_title() -> String {
"shadyurl-rust [running]".to_string()
}

fn prompt_user() -> Result<Self::PromptUserData, Self::Error> {
Ok(())
}
Expand Down

0 comments on commit 15acef3

Please sign in to comment.