mirror of
https://github.com/uutils/coreutils
synced 2024-12-13 14:52:41 +00:00
Rename help_parser => uuhelp_parser
This commit is contained in:
parent
c8b4e06828
commit
e3cb5a111d
7 changed files with 16 additions and 16 deletions
12
Cargo.lock
generated
12
Cargo.lock
generated
|
@ -403,7 +403,6 @@ dependencies = [
|
|||
"conv",
|
||||
"filetime",
|
||||
"glob",
|
||||
"help_parser",
|
||||
"hex-literal",
|
||||
"is-terminal",
|
||||
"libc",
|
||||
|
@ -529,6 +528,7 @@ dependencies = [
|
|||
"uu_whoami",
|
||||
"uu_yes",
|
||||
"uucore",
|
||||
"uuhelp_parser",
|
||||
"walkdir",
|
||||
"zip",
|
||||
]
|
||||
|
@ -1107,10 +1107,6 @@ dependencies = [
|
|||
"ahash",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "help_parser"
|
||||
version = "0.0.18"
|
||||
|
||||
[[package]]
|
||||
name = "hermit-abi"
|
||||
version = "0.1.19"
|
||||
|
@ -3430,11 +3426,15 @@ dependencies = [
|
|||
name = "uucore_procs"
|
||||
version = "0.0.19"
|
||||
dependencies = [
|
||||
"help_parser",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"uuhelp_parser",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uuhelp_parser"
|
||||
version = "0.0.18"
|
||||
|
||||
[[package]]
|
||||
name = "uuid"
|
||||
version = "1.2.2"
|
||||
|
|
|
@ -31,7 +31,7 @@ windows = [ "feat_os_windows" ]
|
|||
nightly = []
|
||||
test_unimplemented = []
|
||||
# * only build `uudoc` when `--feature uudoc` is activated
|
||||
uudoc = ["zip", "dep:help_parser"]
|
||||
uudoc = ["zip", "dep:uuhelp_parser"]
|
||||
## features
|
||||
# "feat_acl" == enable support for ACLs (access control lists; by using`--features feat_acl`)
|
||||
# NOTE:
|
||||
|
@ -358,7 +358,7 @@ selinux = { workspace=true, optional = true }
|
|||
textwrap = { workspace=true }
|
||||
zip = { workspace=true, optional = true }
|
||||
|
||||
help_parser = { path="src/help_parser", optional = true }
|
||||
uuhelp_parser = { path="src/uuhelp_parser", optional = true }
|
||||
|
||||
# * uutils
|
||||
uu_test = { optional=true, version="0.0.19", package="uu_test", path="src/uu/test" }
|
||||
|
|
|
@ -178,7 +178,7 @@ impl<'a, 'b> MDWriter<'a, 'b> {
|
|||
|
||||
fn usage(&mut self) -> io::Result<()> {
|
||||
if let Some(markdown) = &self.markdown {
|
||||
let usage = help_parser::parse_usage(markdown);
|
||||
let usage = uuhelp_parser::parse_usage(markdown);
|
||||
let usage = usage.replace("{}", self.name);
|
||||
|
||||
writeln!(self.w, "\n```")?;
|
||||
|
@ -191,7 +191,7 @@ impl<'a, 'b> MDWriter<'a, 'b> {
|
|||
|
||||
fn about(&mut self) -> io::Result<()> {
|
||||
if let Some(markdown) = &self.markdown {
|
||||
writeln!(self.w, "{}", help_parser::parse_about(markdown))
|
||||
writeln!(self.w, "{}", uuhelp_parser::parse_about(markdown))
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ impl<'a, 'b> MDWriter<'a, 'b> {
|
|||
|
||||
fn after_help(&mut self) -> io::Result<()> {
|
||||
if let Some(markdown) = &self.markdown {
|
||||
if let Some(after_help) = help_parser::parse_section("after help", markdown) {
|
||||
if let Some(after_help) = uuhelp_parser::parse_section("after help", markdown) {
|
||||
return writeln!(self.w, "\n\n{after_help}");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,4 +18,4 @@ proc-macro = true
|
|||
[dependencies]
|
||||
proc-macro2 = "1.0"
|
||||
quote = "1.0"
|
||||
help_parser = { path="../help_parser", version="0.0.18" }
|
||||
uuhelp_parser = { path="../uuhelp_parser", version="0.0.18" }
|
||||
|
|
|
@ -58,7 +58,7 @@ fn render_markdown(s: &str) -> String {
|
|||
pub fn help_about(input: TokenStream) -> TokenStream {
|
||||
let input: Vec<TokenTree> = input.into_iter().collect();
|
||||
let filename = get_argument(&input, 0, "filename");
|
||||
let text: String = help_parser::parse_about(&read_help(&filename));
|
||||
let text: String = uuhelp_parser::parse_about(&read_help(&filename));
|
||||
TokenTree::Literal(Literal::string(&text)).into()
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ pub fn help_about(input: TokenStream) -> TokenStream {
|
|||
pub fn help_usage(input: TokenStream) -> TokenStream {
|
||||
let input: Vec<TokenTree> = input.into_iter().collect();
|
||||
let filename = get_argument(&input, 0, "filename");
|
||||
let text: String = help_parser::parse_usage(&read_help(&filename));
|
||||
let text: String = uuhelp_parser::parse_usage(&read_help(&filename));
|
||||
TokenTree::Literal(Literal::string(&text)).into()
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ pub fn help_section(input: TokenStream) -> TokenStream {
|
|||
let section = get_argument(&input, 0, "section");
|
||||
let filename = get_argument(&input, 1, "filename");
|
||||
|
||||
if let Some(text) = help_parser::parse_section(§ion, &read_help(&filename)) {
|
||||
if let Some(text) = uuhelp_parser::parse_section(§ion, &read_help(&filename)) {
|
||||
let rendered = render_markdown(&text);
|
||||
TokenTree::Literal(Literal::string(&rendered)).into()
|
||||
} else {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "help_parser"
|
||||
name = "uuhelp_parser"
|
||||
version = "0.0.18"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
Loading…
Reference in a new issue