Skip to content

Commit 4abb016

Browse files
authored
Feature: Add URL sort (#270)
1 parent c86ba48 commit 4abb016

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ learn about installation [here](#installation)
114114
|| architecture query || groups field |
115115
|| conflicts query || package description sort |
116116
|| regenerate cache option || validation query |
117-
| - | url sort | - | groups sort |
117+
| | url sort | - | groups sort |
118118
|| packager field || optional dependency field |
119119
|| sort by size on disk | - | conflicts sort |
120120
| - | optional-for sort | - | provides sort |
@@ -358,6 +358,7 @@ qp w q has:depends or has:required-by p and not reason=explicit
358358
- `arch`
359359
- `license`
360360
- `description`
361+
- `url`
361362
- `validation`
362363
- `pkgtype`
363364
- `pkgbase`

internal/pkgdata/sort.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ func GetComparator(field consts.FieldType, asc bool) (PkgComparator, error) {
3535
case consts.FieldDate, consts.FieldBuildDate, consts.FieldSize:
3636
return makeComparator(func(p *PkgInfo) int64 { return p.GetInt(field) }, asc), nil
3737

38-
case consts.FieldName, consts.FieldReason, consts.FieldLicense,
39-
consts.FieldDescription, consts.FieldPkgType,
40-
consts.FieldPkgBase, consts.FieldPackager,
41-
consts.FieldArch, consts.FieldValidation:
38+
case consts.FieldName, consts.FieldReason, consts.FieldArch,
39+
consts.FieldLicense, consts.FieldDescription, consts.FieldUrl,
40+
consts.FieldValidation, consts.FieldPkgType, consts.FieldPkgBase,
41+
consts.FieldPackager:
4242
return makeComparator(func(p *PkgInfo) string {
4343
return strings.ToLower(p.GetString(field))
4444
}, asc), nil

qp.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Existence check — \fBhas:field\fR or \fBno:field\fR
4444

4545
.TP
4646
.B order <field>:<direction>, o <..>
47-
Sort results. Fields: \fBdate\fR, \fBbuild-date\fR, \fBsize\fR, \fBname\fR, \fBreason\fR, \fBarch\fR, \fBlicense\fR, \fBdescription\fR, \fBpkgbase\fR, \fBpkgtype\fR, \fBvalidation\fR, \fBpackager\fR
47+
Sort results. Fields: \fBdate\fR, \fBbuild-date\fR, \fBsize\fR, \fBname\fR, \fBreason\fR, \fBarch\fR, \fBlicense\fR, \fBdescription\fR, \fBurl\fR, \fBpkgbase\fR, \fBpkgtype\fR, \fBvalidation\fR, \fBpackager\fR
4848

4949
.TP
5050
.B limit <number>, l <number>

0 commit comments

Comments
 (0)