|
|
@ -118,14 +118,19 @@ public class Vault implements VaultInterface { |
|
|
|
println("Type in ID or username"); |
|
|
|
|
|
|
|
String str = scan.nextLine(); |
|
|
|
Credential credential = null; |
|
|
|
|
|
|
|
if(str.matches("[0-9]+")) { |
|
|
|
println("Getting credential via ID"); |
|
|
|
credentialRepository.getCredentialsViaId(Integer.parseInt(str)); |
|
|
|
credential = credentialRepository.getCredentialsViaId(Integer.parseInt(str)); |
|
|
|
} else { |
|
|
|
|
|
|
|
println("Getting credential via name"); |
|
|
|
credentialRepository.getCredentialsViaName(str); |
|
|
|
credential = credentialRepository.getCredentialsViaName(str); |
|
|
|
} |
|
|
|
|
|
|
|
if (credential != null) { |
|
|
|
println(credential.getName() + ": " + credential.getPassword()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|