linear-cli 0.2.6

A powerful CLI for Linear.app - manage issues, projects, cycles, and more from your terminal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::io::{self, BufRead};

pub fn read_ids_from_stdin(ids: Vec<String>) -> Vec<String> {
    if ids.is_empty() || (ids.len() == 1 && ids[0] == "-") {
        let stdin = io::stdin();
        return stdin
            .lock()
            .lines()
            .map_while(Result::ok)
            .map(|line| line.trim().to_string())
            .filter(|line| !line.is_empty())
            .collect();
    }

    ids
}