Skip to content

Commit 3379821

Browse files
committed
add format argument to license/renewal command.
- accepts a format string or `timestamp`
1 parent c2b98f5 commit 3379821

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

commands/license/renewal.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,25 @@
66

77
return [
88
'description' => 'Show the renewal date of the activated Kirby license.',
9+
'args' => [
10+
'format' => [
11+
'prefix' => 'f',
12+
'longPrefix' => 'format',
13+
'description' => 'The format for the renewal date or "timestamp"',
14+
'defaultValue' => 'Y-m-d'
15+
]
16+
],
917
'command' => static function (CLI $cli): void {
1018
$kirby = $cli->kirby();
1119

1220
$license = $kirby->system()->license();
21+
$format = $cli->arg('format');
1322

14-
$renewal = $license->renewal();
23+
if (strtolower($format) === 'timestamp') {
24+
$format = null;
25+
}
26+
27+
$renewal = $license->renewal($format);
1528

1629
if ($renewal === null) {
1730
$cli->error('No Kirby License is activated.');

0 commit comments

Comments
 (0)