From dedb969d75f2fedc466dab12cab98d1edfd90edd Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Wed, 6 Apr 2022 23:49:46 +0200 Subject: [PATCH] add help file for base64 --- src/uu/base64/base64.md | 15 +++++++++++++++ src/uu/base64/src/base64.rs | 16 +++------------- 2 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 src/uu/base64/base64.md diff --git a/src/uu/base64/base64.md b/src/uu/base64/base64.md new file mode 100644 index 000000000..864948985 --- /dev/null +++ b/src/uu/base64/base64.md @@ -0,0 +1,15 @@ +# base64 + +## Usage +{} [OPTION]... [FILE] + +## About + +encode/decode data and print to standard output +With no FILE, or when FILE is -, read standard input. + +The data are encoded as described for the base64 alphabet in RFC +3548. When decoding, the input may contain newlines in addition +to the bytes of the formal base64 alphabet. Use --ignore-garbage +to attempt to recover from any other non-alphabet bytes in the +encoded stream. diff --git a/src/uu/base64/src/base64.rs b/src/uu/base64/src/base64.rs index 760142bb2..d0120e4a8 100644 --- a/src/uu/base64/src/base64.rs +++ b/src/uu/base64/src/base64.rs @@ -9,22 +9,12 @@ use uu_base32::base_common; pub use uu_base32::uu_app; -use uucore::{encoding::Format, error::UResult}; +use uucore::{encoding::Format, error::UResult, help_section}; use std::io::{stdin, Read}; -static ABOUT: &str = "\ -encode/decode data and print to standard output -With no FILE, or when FILE is -, read standard input. - -The data are encoded as described for the base64 alphabet in RFC -3548. When decoding, the input may contain newlines in addition -to the bytes of the formal base64 alphabet. Use --ignore-garbage -to attempt to recover from any other non-alphabet bytes in the -encoded stream. -"; - -const USAGE: &str = "{0} [OPTION]... [FILE]"; +const ABOUT: &str = help_section!("about"); +const USAGE: &str = help_section!("usage"); #[uucore::main] pub fn uumain(args: impl uucore::Args) -> UResult<()> {