fix: use the default value on enter, read username from cli arguments
All checks were successful
Update changelog / changelog (push) Successful in 26s
All checks were successful
Update changelog / changelog (push) Successful in 26s
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using Shadow.Data;
|
||||
using Shadow.Entities;
|
||||
using System.Security;
|
||||
|
||||
namespace Shadow.Controllers;
|
||||
public class Cli
|
||||
@@ -91,6 +90,8 @@ public class Cli
|
||||
while (username is null || username == String.Empty)
|
||||
username = ReadName(" Please enter a username: ");
|
||||
}
|
||||
else
|
||||
username = args[1];
|
||||
|
||||
// Check if user by this name exists in DB
|
||||
User? foundUser = db.Users
|
||||
@@ -141,6 +142,8 @@ public class Cli
|
||||
while (username is null || username == String.Empty)
|
||||
username = ReadName(" Please enter a username: ");
|
||||
}
|
||||
else
|
||||
username = args[1];
|
||||
|
||||
// Check if user by this name exists in DB
|
||||
User? foundUser = db.Users
|
||||
@@ -185,6 +188,8 @@ public class Cli
|
||||
while (username is null || username == String.Empty)
|
||||
username = ReadName(" Please enter the username: ");
|
||||
}
|
||||
else
|
||||
username = args[1];
|
||||
|
||||
// Check if user by this name exists in DB
|
||||
User? foundUser = db.Users
|
||||
@@ -283,6 +288,7 @@ public class Cli
|
||||
while (!exit)
|
||||
{
|
||||
if (input is not null && input.Length > 0)
|
||||
{
|
||||
if (input.ToLower().StartsWith("y"))
|
||||
{
|
||||
response = true;
|
||||
@@ -293,6 +299,7 @@ public class Cli
|
||||
response = false;
|
||||
exit = true;
|
||||
}
|
||||
}
|
||||
else if (default_value is not null)
|
||||
{
|
||||
response = (bool)default_value;
|
||||
|
||||
Reference in New Issue
Block a user