Files
marqdo/tests/lib/cli-sort-smoke.mq.md
T
cflmyandCursor abcb141737 refactor: prefer link-index get across examples and tests
Migrate remaining footnote-style collection access in examples,
public/structure, and ext/lib smokes to [key](base); teach link-index in
structure pages and use bracket calls in the cafe journal example.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 12:54:38 +08:00

23 lines
551 B
Markdown

---
title: table sort_by + cli
import table:lib/table.mq.md
import csv:lib/csv.mq.md
import cli:lib/cli.mq.md
---
# main
**raw = "name,score\nbob,2\nalice,10\n"**
**rows = > csv.parse text=`raw`**
**rows = > table.sort_by list=`rows` key="name"**
**r0 = > at value=`rows` index=0**
> print text=[name](`r0`)
**args = > split value="--input,data.csv,rest,--verbose" sep=","**
**flags = > cli.parse args=`args`**
> print text=[input](`flags`)
> print text=[verbose](`flags`)
**pos = [_](`flags`)**
**p0 = > at value=`pos` index=0**
> print text=`p0`