Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximperconf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximperconf
Commits
daaefa53
Commit
daaefa53
authored
Jan 13, 2026
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
repo: add --format flag to deferred info command
- Add DeferredInfo struct for JSON serialization - Add JSON output support to deferred info command
parent
e9d6dc3d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
actions.go
repo/actions.go
+14
-2
commands.go
repo/commands.go
+10
-3
No files found.
repo/actions.go
View file @
daaefa53
package
repo
import
(
"ximperconf/config"
"context"
"fmt"
"io"
"net/http"
"os"
"regexp"
"ximperconf/config"
"ximperconf/ui"
"github.com/fatih/color"
"github.com/urfave/cli/v3"
)
type
DeferredInfo
struct
{
LastUpdate
string
`json:"last_update"`
ArchiveDate
string
`json:"archive_date"`
}
var
(
reLastUpdate
=
regexp
.
MustCompile
(
`Last update date: ([0-9:\- ]+)`
)
reArchiveDate
=
regexp
.
MustCompile
(
`Sisyphus archive date: ([0-9\-]+)`
)
...
...
@@ -73,6 +78,13 @@ func DeferredInfoCommand(ctx context.Context, cmd *cli.Command) error {
lastUpdate
:=
deferredLastUpdate
(
html
)
archiveDate
:=
deferredArchiveDate
(
html
)
if
config
.
IsJSON
(
cmd
)
{
return
ui
.
PrintJSON
(
DeferredInfo
{
LastUpdate
:
lastUpdate
,
ArchiveDate
:
archiveDate
,
})
}
color
.
Green
(
"Deferred:"
)
fmt
.
Printf
(
" Последнее обновление: %s
\n
"
,
lastUpdate
)
fmt
.
Printf
(
" Дата архива: %s
\n
"
,
archiveDate
)
...
...
repo/commands.go
View file @
daaefa53
package
repo
import
"github.com/urfave/cli/v3"
import
(
"ximperconf/config"
"github.com/urfave/cli/v3"
)
func
CommandList
()
*
cli
.
Command
{
return
&
cli
.
Command
{
...
...
@@ -12,8 +16,11 @@ func CommandList() *cli.Command {
Usage
:
"Deferred repo"
,
Commands
:
[]
*
cli
.
Command
{
{
Name
:
"info"
,
Usage
:
"Deferred repo info"
,
Name
:
"info"
,
Usage
:
"Deferred repo info"
,
Flags
:
[]
cli
.
Flag
{
config
.
FormatFlag
,
},
Action
:
DeferredInfoCommand
,
},
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment