13 lines
381 B
Nu
13 lines
381 B
Nu
def "cargo search" [ query: string, --limit=10] {
|
|
^cargo search $query --limit $limit
|
|
| lines
|
|
| each {
|
|
|line| if ($line | str contains "#") {
|
|
$line | parse --regex '(?P<name>.+) = "(?P<version>.+)" +# (?P<description>.+)'
|
|
} else {
|
|
$line | parse --regex '(?P<name>.+) = "(?P<version>.+)"'
|
|
}
|
|
}
|
|
| flatten
|
|
}
|