1.0.0 Alpha Release #59

Merged
netkas merged 213 commits from v1.0.0_alpha into master 2023-01-29 23:27:58 +00:00
Showing only changes of commit e38a4df2ee - Show all commits

View file

@ -50,9 +50,47 @@
return;
}
if(isset($args['list']))
{
try
{
self::listEntries();
}
catch(Exception $e)
{
Console::outException('Cannot list credentials.', $e, 1);
}
return;
}
self::displayOptions();
}
/**
* Prints the list of entries in the vault
*
* @return void
*/
public static function listEntries(): void
{
$credential_manager = new CredentialManager();
$entries = $credential_manager->getVault()->getEntries();
if(count($entries) === 0)
{
Console::out('No credentials found.');
return;
}
foreach($entries as $entry)
{
Console::out(sprintf('%s%s', $entry->getName(), ($entry->isEncrypted() ? ' (encrypted)' : '')));
}
Console::out('Total: ' . count($entries));
}
/**
* @param $args
* @return void