cksum: move help strings to markdown file

This commit is contained in:
ValentinyFilip 2023-03-15 19:09:38 +01:00
parent 8c885b383a
commit 61ad84f447
2 changed files with 30 additions and 18 deletions

23
src/uu/cksum/cksum.md Normal file
View file

@ -0,0 +1,23 @@
# cksum
```
cksum [OPTIONS] [FILE]...
```
Print CRC and size for each file
## After Help
DIGEST determines the digest algorithm and default output format:
-a=sysv: (equivalent to sum -s)
-a=bsd: (equivalent to sum -r)
-a=crc: (equivalent to cksum)
-a=md5: (equivalent to md5sum)
-a=sha1: (equivalent to sha1sum)
-a=sha224: (equivalent to sha224sum)
-a=sha256: (equivalent to sha256sum)
-a=sha384: (equivalent to sha384sum)
-a=sha512: (equivalent to sha512sum)
-a=blake2b: (equivalent to b2sum)
-a=sm3: (only available through cksum)

View file

@ -20,10 +20,14 @@ use uucore::{
div_ceil, Blake2b, Digest, DigestWriter, Md5, Sha1, Sha224, Sha256, Sha384, Sha512, Sm3,
BSD, CRC, SYSV,
},
help_about,
help_usage,
help_section,
};
const USAGE: &str = "{} [OPTIONS] [FILE]...";
const ABOUT: &str = "Print CRC and size for each file";
const USAGE: &str = help_usage!("cksum.md");
const ABOUT: &str = help_about!("cksum.md");
const AFTER_HELP: &str = help_section!("after help", "cksum.md");
const ALGORITHM_OPTIONS_SYSV: &str = "sysv";
const ALGORITHM_OPTIONS_BSD: &str = "bsd";
@ -205,21 +209,6 @@ mod options {
pub static ALGORITHM: &str = "algorithm";
}
const ALGORITHM_HELP_DESC: &str =
"DIGEST determines the digest algorithm and default output format:\n\
\n\
-a=sysv: (equivalent to sum -s)\n\
-a=bsd: (equivalent to sum -r)\n\
-a=crc: (equivalent to cksum)\n\
-a=md5: (equivalent to md5sum)\n\
-a=sha1: (equivalent to sha1sum)\n\
-a=sha224: (equivalent to sha224sum)\n\
-a=sha256: (equivalent to sha256sum)\n\
-a=sha384: (equivalent to sha384sum)\n\
-a=sha512: (equivalent to sha512sum)\n\
-a=blake2b: (equivalent to b2sum)\n\
-a=sm3: (only available through cksum)\n";
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let args = args.collect_ignore();
@ -278,5 +267,5 @@ pub fn uu_app() -> Command {
ALGORITHM_OPTIONS_SM3,
]),
)
.after_help(ALGORITHM_HELP_DESC)
.after_help(AFTER_HELP)
}