mirror of
https://github.com/lune-org/lune.git
synced 2024-12-13 05:20:37 +00:00
Fix list subcommand not printing multiline descriptions properly
This commit is contained in:
parent
42ab2da1ed
commit
0773dc024a
3 changed files with 20 additions and 0 deletions
16
Cargo.lock
generated
16
Cargo.lock
generated
|
@ -575,6 +575,12 @@ version = "1.0.4"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b"
|
||||
|
||||
[[package]]
|
||||
name = "either"
|
||||
version = "1.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91"
|
||||
|
||||
[[package]]
|
||||
name = "encode_unicode"
|
||||
version = "0.3.6"
|
||||
|
@ -1042,6 +1048,15 @@ dependencies = [
|
|||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.10.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
|
||||
dependencies = [
|
||||
"either",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "1.0.6"
|
||||
|
@ -1179,6 +1194,7 @@ dependencies = [
|
|||
"full_moon",
|
||||
"futures-util",
|
||||
"include_dir",
|
||||
"itertools",
|
||||
"lune",
|
||||
"once_cell",
|
||||
"regex",
|
||||
|
|
|
@ -34,6 +34,7 @@ tokio.workspace = true
|
|||
|
||||
anyhow = "1.0"
|
||||
env_logger = "0.10"
|
||||
itertools = "0.10"
|
||||
|
||||
clap = { version = "4.1", features = ["derive"] }
|
||||
full_moon = { version = "0.17", features = ["roblox"] }
|
||||
|
|
|
@ -6,6 +6,7 @@ use std::{
|
|||
use anyhow::{anyhow, bail, Result};
|
||||
use console::style;
|
||||
use directories::UserDirs;
|
||||
use itertools::Itertools;
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
const LUNE_COMMENT_PREFIX: &str = "-->";
|
||||
|
@ -178,6 +179,8 @@ pub fn parse_lune_description_from_file(contents: &str) -> Option<String> {
|
|||
let unindented_lines = comment_lines
|
||||
.iter()
|
||||
.map(|line| &line[shortest_indent..])
|
||||
// Replace newlines with a single space inbetween instead
|
||||
.interleave(std::iter::repeat(" ").take(comment_lines.len() - 1))
|
||||
.collect();
|
||||
Some(unindented_lines)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue