---
Summary: Sort `sbl`
Status: Done
---

# Description

We need to be able to sort cards in `sbl`.

The expectation is that the user should be able to:

-   sort by any field;
-   have numbers sorted sensibly; and
-   set a default sort in config.

# Cucumber

**GIVEN** a scrum repository
**WHEN** `sbl --sort [FIELD]` is run
**THEN** the cards are sorted by the field

**GIVEN** a scrum field with fields are integer or real numbers
**WHEN** those cards are sorted
**THEN** those number fields are sorted in numerical not string order

**GIVEN** a scrum repository
**WHEN** `sbl --sort` is run
**THEN** a default field from the config is sorted by (defaulting to index)

**GIVEN** a grouped scrum collection
**WHEN** the collection is sorted
**THEN** the groups are sorted individually
