1.0.0 Alpha Release #59
1 changed files with 5 additions and 7 deletions
|
@ -40,6 +40,7 @@ namespace ncc\CLI\Management;
|
||||||
*
|
*
|
||||||
* @param $args
|
* @param $args
|
||||||
* @return void
|
* @return void
|
||||||
|
* @noinspection DuplicatedCode
|
||||||
*/
|
*/
|
||||||
public static function start($args): void
|
public static function start($args): void
|
||||||
{
|
{
|
||||||
|
@ -209,7 +210,7 @@ namespace ncc\CLI\Management;
|
||||||
$username = $args['username'] ?? $args['usr'] ?? null;
|
$username = $args['username'] ?? $args['usr'] ?? null;
|
||||||
$password = $args['password'] ?? $args['pwd'] ?? null;
|
$password = $args['password'] ?? $args['pwd'] ?? null;
|
||||||
$token = $args['token'] ?? $args['pat'] ?? $args['private-token'] ?? null;
|
$token = $args['token'] ?? $args['pat'] ?? $args['private-token'] ?? null;
|
||||||
$encrypt = $args['encrypt'] ?? $args['encrypted'] ?? null;
|
$encrypt = !isset($args['no-encryption']);
|
||||||
|
|
||||||
if($name === null)
|
if($name === null)
|
||||||
$name = Console::getInput('Enter a name for the entry: ');
|
$name = Console::getInput('Enter a name for the entry: ');
|
||||||
|
@ -235,9 +236,6 @@ namespace ncc\CLI\Management;
|
||||||
Console::outError('Invalid authentication type');
|
Console::outError('Invalid authentication type');
|
||||||
}
|
}
|
||||||
|
|
||||||
if($encrypt === null)
|
|
||||||
$encrypt = Console::getBooleanInput('Encrypt entry with your password?');
|
|
||||||
|
|
||||||
if($name === null)
|
if($name === null)
|
||||||
{
|
{
|
||||||
Console::outError('You must specify a name for the entry (alias, name)', true, 1);
|
Console::outError('You must specify a name for the entry (alias, name)', true, 1);
|
||||||
|
@ -373,7 +371,7 @@ namespace ncc\CLI\Management;
|
||||||
Console::outHelpSections([
|
Console::outHelpSections([
|
||||||
new CliHelpSection(['--name'], 'The name of the entry'),
|
new CliHelpSection(['--name'], 'The name of the entry'),
|
||||||
new CliHelpSection(['--auth-type', '--auth'], 'The type of authentication (login, pat)'),
|
new CliHelpSection(['--auth-type', '--auth'], 'The type of authentication (login, pat)'),
|
||||||
new CliHelpSection(['--encrypted', '--encrypt'], 'Whether or not to encrypt the entry', true),
|
new CliHelpSection(['--no-encryption'], 'Omit encryption to the entry (By default it\'s encrypted)', true),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Console::out(' login authentication type options:');
|
Console::out(' login authentication type options:');
|
||||||
|
@ -392,8 +390,8 @@ namespace ncc\CLI\Management;
|
||||||
Console::out(' pat' . PHP_EOL);
|
Console::out(' pat' . PHP_EOL);
|
||||||
|
|
||||||
Console::out('Examples:');
|
Console::out('Examples:');
|
||||||
Console::out(' ncc cred add --alias "My Alias" --auth-type login --username "myusername" --password "mypassword" --encrypt');
|
Console::out(' ncc cred add --alias "My Alias" --auth-type login --username "myusername" --password "mypassword"');
|
||||||
Console::out(' ncc cred add --alias "My Alias" --auth-type pat --token "mytoken"');
|
Console::out(' ncc cred add --alias "My Alias" --auth-type pat --token "mytoken" --no-encryption');
|
||||||
Console::out(' ncc cred remove --alias "My Alias"');
|
Console::out(' ncc cred remove --alias "My Alias"');
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue