From 951035e49ceadb1aa1a3f27115aa2577e760adfb Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Thu, 20 Jan 2022 15:00:16 +0100 Subject: [PATCH 01/15] mdbook docs --- Cargo.toml | 4 ++ docs/docs/.gitignore | 1 + docs/docs/book.toml | 6 ++ docs/docs/src/SUMMARY.md | 3 + docs/docs/src/chapter_1.md | 1 + src/bin/uudoc.rs | 114 +++++++++++++++++++++++++++++++++++++ 6 files changed, 129 insertions(+) create mode 100644 docs/docs/.gitignore create mode 100644 docs/docs/book.toml create mode 100644 docs/docs/src/SUMMARY.md create mode 100644 docs/docs/src/chapter_1.md create mode 100644 src/bin/uudoc.rs diff --git a/Cargo.toml b/Cargo.toml index a099115a6..cbb91bf32 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -389,3 +389,7 @@ unix_socket = "0.5.0" [[bin]] name = "coreutils" path = "src/bin/coreutils.rs" + +[[bin]] +name = "uudoc" +path = "src/bin/uudoc.rs" diff --git a/docs/docs/.gitignore b/docs/docs/.gitignore new file mode 100644 index 000000000..7585238ef --- /dev/null +++ b/docs/docs/.gitignore @@ -0,0 +1 @@ +book diff --git a/docs/docs/book.toml b/docs/docs/book.toml new file mode 100644 index 000000000..fe32ddf98 --- /dev/null +++ b/docs/docs/book.toml @@ -0,0 +1,6 @@ +[book] +authors = ["Terts Diepraam"] +language = "en" +multilingual = false +src = "src" +title = "Uutils Documentation" diff --git a/docs/docs/src/SUMMARY.md b/docs/docs/src/SUMMARY.md new file mode 100644 index 000000000..7390c8289 --- /dev/null +++ b/docs/docs/src/SUMMARY.md @@ -0,0 +1,3 @@ +# Summary + +- [Chapter 1](./chapter_1.md) diff --git a/docs/docs/src/chapter_1.md b/docs/docs/src/chapter_1.md new file mode 100644 index 000000000..b743fda35 --- /dev/null +++ b/docs/docs/src/chapter_1.md @@ -0,0 +1 @@ +# Chapter 1 diff --git a/src/bin/uudoc.rs b/src/bin/uudoc.rs new file mode 100644 index 000000000..65da4c7cc --- /dev/null +++ b/src/bin/uudoc.rs @@ -0,0 +1,114 @@ +// This file is part of the uutils coreutils package. +// +// (c) Michael Gehring +// +// For the full copyright and license information, please view the LICENSE +// file that was distributed with this source code. + +use clap::App; +use clap::Arg; +use clap::Shell; +use std::cmp; +use std::collections::hash_map::HashMap; +use std::ffi::OsStr; +use std::ffi::OsString; +use std::io::{self, Write}; +use std::path::{Path, PathBuf}; +use std::process; +use uucore::display::Quotable; + +const VERSION: &str = env!("CARGO_PKG_VERSION"); + +include!(concat!(env!("OUT_DIR"), "/uutils_map.rs")); + +fn usage(utils: &UtilityMap, name: &str) { + println!("{} {}\n", name, VERSION); + println!("Generate markdown documentation for uutils"); + println!("Usage: {} [util]\n", name); + println!("Currently defined functions:\n"); + #[allow(clippy::map_clone)] + let mut utils: Vec<&str> = utils.keys().map(|&s| s).collect(); + utils.sort_unstable(); + let display_list = utils.join(", "); + let width = cmp::min(textwrap::termwidth(), 100) - 4 * 2; // (opinion/heuristic) max 100 chars wide with 4 character side indentions + println!( + "{}", + textwrap::indent(&textwrap::fill(&display_list, width), " ") + ); +} + +fn binary_path(args: &mut impl Iterator) -> PathBuf { + match args.next() { + Some(ref s) if !s.is_empty() => PathBuf::from(s), + _ => std::env::current_exe().unwrap(), + } +} + +fn name(binary_path: &Path) -> &str { + binary_path.file_stem().unwrap().to_str().unwrap() +} + +fn main() { + uucore::panic::mute_sigpipe_panic(); + + let utils = util_map(); + let mut args = uucore::args_os(); + + let binary = binary_path(&mut args); + let binary_as_util = name(&binary); + + // binary name equals util name? + if let Some(&(uumain, _)) = utils.get(binary_as_util) { + process::exit(uumain((vec![binary.into()].into_iter()).chain(args))); + } + + // binary name equals prefixed util name? + // * prefix/stem may be any string ending in a non-alphanumeric character + let util_name = if let Some(util) = utils.keys().find(|util| { + binary_as_util.ends_with(*util) + && !(&binary_as_util[..binary_as_util.len() - (*util).len()]) + .ends_with(char::is_alphanumeric) + }) { + // prefixed util => replace 0th (aka, executable name) argument + Some(OsString::from(*util)) + } else { + // unmatched binary name => regard as multi-binary container and advance argument list + uucore::set_utility_is_second_arg(); + args.next() + }; + + // 0th argument equals util name? + if let Some(util_os) = util_name { + fn not_found(util: &OsStr) -> ! { + println!("{}: function/utility not found", util.maybe_quote()); + process::exit(1); + } + + let util = match util_os.to_str() { + Some(util) => util, + None => not_found(&util_os), + }; + + match utils.get(util) { + Some(&(uumain, app)) => { + print_markdown(app); + } + None => { + if util == "--help" || util == "-h" { + usage(&utils, binary_as_util); + process::exit(0); + } else { + not_found(&util_os); + } + } + } + } else { + // no arguments provided + usage(&utils, binary_as_util); + process::exit(0); + } +} + +fn print_markdown(app: &App) { + for arg in app.get_arguments() {} +} From cf42008150c156b1f518c35ec4534ee7c5f9bcdd Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Thu, 20 Jan 2022 16:46:49 +0100 Subject: [PATCH 02/15] autogenerated mdbook documentation --- Cargo.toml | 1 + docs/.gitignore | 2 + docs/CONTRIBUTING.html | 185 ++++++++++++++++++++++++++++++++++++ docs/CONTRIBUTING.md | 1 + docs/arch.rst | 28 ------ docs/book.toml | 9 ++ docs/create_docs.py | 20 ++++ docs/docs/.gitignore | 1 - docs/docs/book.toml | 6 -- docs/docs/src/SUMMARY.md | 3 - docs/docs/src/chapter_1.md | 1 - docs/index.rst | 24 ----- docs/src/SUMMARY.md | 105 ++++++++++++++++++++ docs/src/contributing.md | 1 + docs/src/introduction.md | 8 ++ docs/src/utils/arch.md | 3 + docs/src/utils/base32.md | 3 + docs/src/utils/base64.md | 3 + docs/src/utils/basename.md | 3 + docs/src/utils/basenc.md | 3 + docs/src/utils/cat.md | 3 + docs/src/utils/chcon.md | 3 + docs/src/utils/chgrp.md | 3 + docs/src/utils/chmod.md | 3 + docs/src/utils/chown.md | 3 + docs/src/utils/chroot.md | 3 + docs/src/utils/cksum.md | 3 + docs/src/utils/comm.md | 3 + docs/src/utils/cp.md | 3 + docs/src/utils/csplit.md | 3 + docs/src/utils/cut.md | 3 + docs/src/utils/date.md | 3 + docs/src/utils/dd.md | 3 + docs/src/utils/df.md | 3 + docs/src/utils/dircolors.md | 3 + docs/src/utils/dirname.md | 3 + docs/src/utils/du.md | 3 + docs/src/utils/echo.md | 3 + docs/src/utils/env.md | 3 + docs/src/utils/expand.md | 3 + docs/src/utils/expr.md | 3 + docs/src/utils/factor.md | 3 + docs/src/utils/false.md | 3 + docs/src/utils/fmt.md | 3 + docs/src/utils/fold.md | 3 + docs/src/utils/groups.md | 3 + docs/src/utils/hashsum.md | 3 + docs/src/utils/head.md | 3 + docs/src/utils/hostid.md | 3 + docs/src/utils/hostname.md | 3 + docs/src/utils/id.md | 3 + docs/src/utils/index.md | 102 ++++++++++++++++++++ docs/src/utils/install.md | 3 + docs/src/utils/join.md | 3 + docs/src/utils/kill.md | 3 + docs/src/utils/link.md | 3 + docs/src/utils/ln.md | 3 + docs/src/utils/logname.md | 3 + docs/src/utils/ls.md | 3 + docs/src/utils/mkdir.md | 3 + docs/src/utils/mkfifo.md | 3 + docs/src/utils/mknod.md | 3 + docs/src/utils/mktemp.md | 3 + docs/src/utils/more.md | 3 + docs/src/utils/mv.md | 3 + docs/src/utils/nice.md | 3 + docs/src/utils/nl.md | 3 + docs/src/utils/nohup.md | 3 + docs/src/utils/nproc.md | 3 + docs/src/utils/numfmt.md | 3 + docs/src/utils/od.md | 3 + docs/src/utils/paste.md | 3 + docs/src/utils/pathchk.md | 3 + docs/src/utils/pinky.md | 3 + docs/src/utils/pr.md | 3 + docs/src/utils/printenv.md | 3 + docs/src/utils/printf.md | 3 + docs/src/utils/ptx.md | 3 + docs/src/utils/pwd.md | 3 + docs/src/utils/readlink.md | 3 + docs/src/utils/realpath.md | 3 + docs/src/utils/relpath.md | 3 + docs/src/utils/rm.md | 3 + docs/src/utils/rmdir.md | 3 + docs/src/utils/runcon.md | 3 + docs/src/utils/seq.md | 3 + docs/src/utils/shred.md | 3 + docs/src/utils/shuf.md | 3 + docs/src/utils/sleep.md | 3 + docs/src/utils/sort.md | 3 + docs/src/utils/split.md | 3 + docs/src/utils/stat.md | 3 + docs/src/utils/stdbuf.md | 3 + docs/src/utils/sum.md | 3 + docs/src/utils/sync.md | 3 + docs/src/utils/tac.md | 3 + docs/src/utils/tail.md | 3 + docs/src/utils/tee.md | 3 + docs/src/utils/test.md | 3 + docs/src/utils/timeout.md | 3 + docs/src/utils/touch.md | 3 + docs/src/utils/tr.md | 3 + docs/src/utils/true.md | 3 + docs/src/utils/truncate.md | 3 + docs/src/utils/tsort.md | 3 + docs/src/utils/tty.md | 3 + docs/src/utils/uname.md | 3 + docs/src/utils/unexpand.md | 3 + docs/src/utils/uniq.md | 3 + docs/src/utils/unlink.md | 3 + docs/src/utils/uptime.md | 3 + docs/src/utils/users.md | 3 + docs/src/utils/wc.md | 3 + docs/src/utils/who.md | 3 + docs/src/utils/whoami.md | 3 + docs/src/utils/yes.md | 3 + docs/uutils.rst | 24 ----- src/bin/uudoc.rs | 139 +++++++++------------------ 118 files changed, 781 insertions(+), 179 deletions(-) create mode 100644 docs/.gitignore create mode 100644 docs/CONTRIBUTING.html create mode 100644 docs/CONTRIBUTING.md delete mode 100644 docs/arch.rst create mode 100644 docs/book.toml create mode 100644 docs/create_docs.py delete mode 100644 docs/docs/.gitignore delete mode 100644 docs/docs/book.toml delete mode 100644 docs/docs/src/SUMMARY.md delete mode 100644 docs/docs/src/chapter_1.md delete mode 100644 docs/index.rst create mode 100644 docs/src/SUMMARY.md create mode 100644 docs/src/contributing.md create mode 100644 docs/src/introduction.md create mode 100644 docs/src/utils/arch.md create mode 100644 docs/src/utils/base32.md create mode 100644 docs/src/utils/base64.md create mode 100644 docs/src/utils/basename.md create mode 100644 docs/src/utils/basenc.md create mode 100644 docs/src/utils/cat.md create mode 100644 docs/src/utils/chcon.md create mode 100644 docs/src/utils/chgrp.md create mode 100644 docs/src/utils/chmod.md create mode 100644 docs/src/utils/chown.md create mode 100644 docs/src/utils/chroot.md create mode 100644 docs/src/utils/cksum.md create mode 100644 docs/src/utils/comm.md create mode 100644 docs/src/utils/cp.md create mode 100644 docs/src/utils/csplit.md create mode 100644 docs/src/utils/cut.md create mode 100644 docs/src/utils/date.md create mode 100644 docs/src/utils/dd.md create mode 100644 docs/src/utils/df.md create mode 100644 docs/src/utils/dircolors.md create mode 100644 docs/src/utils/dirname.md create mode 100644 docs/src/utils/du.md create mode 100644 docs/src/utils/echo.md create mode 100644 docs/src/utils/env.md create mode 100644 docs/src/utils/expand.md create mode 100644 docs/src/utils/expr.md create mode 100644 docs/src/utils/factor.md create mode 100644 docs/src/utils/false.md create mode 100644 docs/src/utils/fmt.md create mode 100644 docs/src/utils/fold.md create mode 100644 docs/src/utils/groups.md create mode 100644 docs/src/utils/hashsum.md create mode 100644 docs/src/utils/head.md create mode 100644 docs/src/utils/hostid.md create mode 100644 docs/src/utils/hostname.md create mode 100644 docs/src/utils/id.md create mode 100644 docs/src/utils/index.md create mode 100644 docs/src/utils/install.md create mode 100644 docs/src/utils/join.md create mode 100644 docs/src/utils/kill.md create mode 100644 docs/src/utils/link.md create mode 100644 docs/src/utils/ln.md create mode 100644 docs/src/utils/logname.md create mode 100644 docs/src/utils/ls.md create mode 100644 docs/src/utils/mkdir.md create mode 100644 docs/src/utils/mkfifo.md create mode 100644 docs/src/utils/mknod.md create mode 100644 docs/src/utils/mktemp.md create mode 100644 docs/src/utils/more.md create mode 100644 docs/src/utils/mv.md create mode 100644 docs/src/utils/nice.md create mode 100644 docs/src/utils/nl.md create mode 100644 docs/src/utils/nohup.md create mode 100644 docs/src/utils/nproc.md create mode 100644 docs/src/utils/numfmt.md create mode 100644 docs/src/utils/od.md create mode 100644 docs/src/utils/paste.md create mode 100644 docs/src/utils/pathchk.md create mode 100644 docs/src/utils/pinky.md create mode 100644 docs/src/utils/pr.md create mode 100644 docs/src/utils/printenv.md create mode 100644 docs/src/utils/printf.md create mode 100644 docs/src/utils/ptx.md create mode 100644 docs/src/utils/pwd.md create mode 100644 docs/src/utils/readlink.md create mode 100644 docs/src/utils/realpath.md create mode 100644 docs/src/utils/relpath.md create mode 100644 docs/src/utils/rm.md create mode 100644 docs/src/utils/rmdir.md create mode 100644 docs/src/utils/runcon.md create mode 100644 docs/src/utils/seq.md create mode 100644 docs/src/utils/shred.md create mode 100644 docs/src/utils/shuf.md create mode 100644 docs/src/utils/sleep.md create mode 100644 docs/src/utils/sort.md create mode 100644 docs/src/utils/split.md create mode 100644 docs/src/utils/stat.md create mode 100644 docs/src/utils/stdbuf.md create mode 100644 docs/src/utils/sum.md create mode 100644 docs/src/utils/sync.md create mode 100644 docs/src/utils/tac.md create mode 100644 docs/src/utils/tail.md create mode 100644 docs/src/utils/tee.md create mode 100644 docs/src/utils/test.md create mode 100644 docs/src/utils/timeout.md create mode 100644 docs/src/utils/touch.md create mode 100644 docs/src/utils/tr.md create mode 100644 docs/src/utils/true.md create mode 100644 docs/src/utils/truncate.md create mode 100644 docs/src/utils/tsort.md create mode 100644 docs/src/utils/tty.md create mode 100644 docs/src/utils/uname.md create mode 100644 docs/src/utils/unexpand.md create mode 100644 docs/src/utils/uniq.md create mode 100644 docs/src/utils/unlink.md create mode 100644 docs/src/utils/uptime.md create mode 100644 docs/src/utils/users.md create mode 100644 docs/src/utils/wc.md create mode 100644 docs/src/utils/who.md create mode 100644 docs/src/utils/whoami.md create mode 100644 docs/src/utils/yes.md delete mode 100644 docs/uutils.rst diff --git a/Cargo.toml b/Cargo.toml index cbb91bf32..885bcf071 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "coreutils ~ GNU coreutils (updated); implemented as universal (cross-platform) utils, written in Rust" +default-run = "coreutils" homepage = "https://github.com/uutils/coreutils" repository = "https://github.com/uutils/coreutils" diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 000000000..0b2699ecb --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,2 @@ +book +_generated \ No newline at end of file diff --git a/docs/CONTRIBUTING.html b/docs/CONTRIBUTING.html new file mode 100644 index 000000000..80098ad2d --- /dev/null +++ b/docs/CONTRIBUTING.html @@ -0,0 +1,185 @@ + + + + + + Contributing - Uutils Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+
+

Contributing

+ +
+ + +
+
+ + + +
+ + + + + + + + + + + + + + diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md new file mode 100644 index 000000000..854139a31 --- /dev/null +++ b/docs/CONTRIBUTING.md @@ -0,0 +1 @@ +# Contributing diff --git a/docs/arch.rst b/docs/arch.rst deleted file mode 100644 index 66b516159..000000000 --- a/docs/arch.rst +++ /dev/null @@ -1,28 +0,0 @@ -.. print machine hardware name - -==== -arch -==== - -.. FIXME: this needs to be autogenerated somehow - --------- -Synopsis --------- - -``arch`` [OPTION]... - ------------ -Description ------------ - -``arch`` is an alias for ``uname -m``. They both print the machine hardware -name. - -An exit code of zero indicates success, whereas anything else means failure. -For this program, a non-zero exit code generally means the user provided -invalid options. - --h, --help print a help menu for this program displaying accepted - options and arguments --v, --version print the version number of this program diff --git a/docs/book.toml b/docs/book.toml new file mode 100644 index 000000000..10e64f3c9 --- /dev/null +++ b/docs/book.toml @@ -0,0 +1,9 @@ +[book] +authors = ["uutils contributors"] +language = "en" +multilingual = false +src = "src" +title = "Uutils Documentation" + +[output.html] +git-repository-url = "https://github.com/rust-lang/cargo/tree/master/src/doc/src" \ No newline at end of file diff --git a/docs/create_docs.py b/docs/create_docs.py new file mode 100644 index 000000000..b07b851fa --- /dev/null +++ b/docs/create_docs.py @@ -0,0 +1,20 @@ +# Simple script to create the correct SUMMARY.md and other files +# for the mdbook documentation. +# Note: This will overwrite the existing files! + +import os + +with open('src/utils/index.md', 'w') as index: + with open('src/SUMMARY.md', 'w') as summary: + summary.write("# Summary\n\n") + summary.write("* [Introduction](introduction.md)\n") + summary.write("* [Contributing](contributing.md)\n") + summary.write("* [Utils](utils/index.md)\n") + index.write("# Utils\n\n") + for d in sorted(os.listdir('../src/uu')): + with open(f"src/utils/{d}.md", 'w') as f: + f.write(f"# {d}\n\n") + f.write(f"{{{{ #include ../../_generated/{d}-help.md }}}}\n") + print(f"Created docs/src/utils/{d}.md") + summary.write(f" * [{d}](utils/{d}.md)\n") + index.write(f"* [{d}](./{d}.md)\n") \ No newline at end of file diff --git a/docs/docs/.gitignore b/docs/docs/.gitignore deleted file mode 100644 index 7585238ef..000000000 --- a/docs/docs/.gitignore +++ /dev/null @@ -1 +0,0 @@ -book diff --git a/docs/docs/book.toml b/docs/docs/book.toml deleted file mode 100644 index fe32ddf98..000000000 --- a/docs/docs/book.toml +++ /dev/null @@ -1,6 +0,0 @@ -[book] -authors = ["Terts Diepraam"] -language = "en" -multilingual = false -src = "src" -title = "Uutils Documentation" diff --git a/docs/docs/src/SUMMARY.md b/docs/docs/src/SUMMARY.md deleted file mode 100644 index 7390c8289..000000000 --- a/docs/docs/src/SUMMARY.md +++ /dev/null @@ -1,3 +0,0 @@ -# Summary - -- [Chapter 1](./chapter_1.md) diff --git a/docs/docs/src/chapter_1.md b/docs/docs/src/chapter_1.md deleted file mode 100644 index b743fda35..000000000 --- a/docs/docs/src/chapter_1.md +++ /dev/null @@ -1 +0,0 @@ -# Chapter 1 diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index 7f782b12a..000000000 --- a/docs/index.rst +++ /dev/null @@ -1,24 +0,0 @@ -.. uutils documentation master file, created by - sphinx-quickstart on Tue Dec 5 23:20:18 2017. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -.. - spell-checker:ignore (directives) genindex maxdepth modindex toctree ; (misc) quickstart - -Welcome to uutils' documentation! -================================= - -.. toctree:: - :maxdepth: 2 - :caption: Contents: - - arch - uutils - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md new file mode 100644 index 000000000..bc595000a --- /dev/null +++ b/docs/src/SUMMARY.md @@ -0,0 +1,105 @@ +# Summary + +* [Introduction](introduction.md) +* [Contributing](contributing.md) +* [Utils](utils/index.md) + * [arch](utils/arch.md) + * [base32](utils/base32.md) + * [base64](utils/base64.md) + * [basename](utils/basename.md) + * [basenc](utils/basenc.md) + * [cat](utils/cat.md) + * [chcon](utils/chcon.md) + * [chgrp](utils/chgrp.md) + * [chmod](utils/chmod.md) + * [chown](utils/chown.md) + * [chroot](utils/chroot.md) + * [cksum](utils/cksum.md) + * [comm](utils/comm.md) + * [cp](utils/cp.md) + * [csplit](utils/csplit.md) + * [cut](utils/cut.md) + * [date](utils/date.md) + * [dd](utils/dd.md) + * [df](utils/df.md) + * [dircolors](utils/dircolors.md) + * [dirname](utils/dirname.md) + * [du](utils/du.md) + * [echo](utils/echo.md) + * [env](utils/env.md) + * [expand](utils/expand.md) + * [expr](utils/expr.md) + * [factor](utils/factor.md) + * [false](utils/false.md) + * [fmt](utils/fmt.md) + * [fold](utils/fold.md) + * [groups](utils/groups.md) + * [hashsum](utils/hashsum.md) + * [head](utils/head.md) + * [hostid](utils/hostid.md) + * [hostname](utils/hostname.md) + * [id](utils/id.md) + * [install](utils/install.md) + * [join](utils/join.md) + * [kill](utils/kill.md) + * [link](utils/link.md) + * [ln](utils/ln.md) + * [logname](utils/logname.md) + * [ls](utils/ls.md) + * [mkdir](utils/mkdir.md) + * [mkfifo](utils/mkfifo.md) + * [mknod](utils/mknod.md) + * [mktemp](utils/mktemp.md) + * [more](utils/more.md) + * [mv](utils/mv.md) + * [nice](utils/nice.md) + * [nl](utils/nl.md) + * [nohup](utils/nohup.md) + * [nproc](utils/nproc.md) + * [numfmt](utils/numfmt.md) + * [od](utils/od.md) + * [paste](utils/paste.md) + * [pathchk](utils/pathchk.md) + * [pinky](utils/pinky.md) + * [pr](utils/pr.md) + * [printenv](utils/printenv.md) + * [printf](utils/printf.md) + * [ptx](utils/ptx.md) + * [pwd](utils/pwd.md) + * [readlink](utils/readlink.md) + * [realpath](utils/realpath.md) + * [relpath](utils/relpath.md) + * [rm](utils/rm.md) + * [rmdir](utils/rmdir.md) + * [runcon](utils/runcon.md) + * [seq](utils/seq.md) + * [shred](utils/shred.md) + * [shuf](utils/shuf.md) + * [sleep](utils/sleep.md) + * [sort](utils/sort.md) + * [split](utils/split.md) + * [stat](utils/stat.md) + * [stdbuf](utils/stdbuf.md) + * [sum](utils/sum.md) + * [sync](utils/sync.md) + * [tac](utils/tac.md) + * [tail](utils/tail.md) + * [tee](utils/tee.md) + * [test](utils/test.md) + * [timeout](utils/timeout.md) + * [touch](utils/touch.md) + * [tr](utils/tr.md) + * [true](utils/true.md) + * [truncate](utils/truncate.md) + * [tsort](utils/tsort.md) + * [tty](utils/tty.md) + * [uname](utils/uname.md) + * [unexpand](utils/unexpand.md) + * [uniq](utils/uniq.md) + * [unlink](utils/unlink.md) + * [uptime](utils/uptime.md) + * [users](utils/users.md) + * [wc](utils/wc.md) + * [who](utils/who.md) + * [whoami](utils/whoami.md) + * [yes](utils/yes.md) diff --git a/docs/src/contributing.md b/docs/src/contributing.md new file mode 100644 index 000000000..79ef4d13b --- /dev/null +++ b/docs/src/contributing.md @@ -0,0 +1 @@ +{{ #include ../../CONTRIBUTING.md }} \ No newline at end of file diff --git a/docs/src/introduction.md b/docs/src/introduction.md new file mode 100644 index 000000000..261205d34 --- /dev/null +++ b/docs/src/introduction.md @@ -0,0 +1,8 @@ +# Introduction + +uutils is an attempt at writing universal (as in cross-platform) CLI +utilities in [Rust](https://www.rust-lang.org). The source code is hosted +on [GitHub](https://github.com/uutils/coreutils). + +> Note: This manual is automatically generated from the source code and is +> a work in progress. \ No newline at end of file diff --git a/docs/src/utils/arch.md b/docs/src/utils/arch.md new file mode 100644 index 000000000..b0ca5c7e9 --- /dev/null +++ b/docs/src/utils/arch.md @@ -0,0 +1,3 @@ +# arch + +{{ #include ../../_generated/arch-help.md }} diff --git a/docs/src/utils/base32.md b/docs/src/utils/base32.md new file mode 100644 index 000000000..d79092b3d --- /dev/null +++ b/docs/src/utils/base32.md @@ -0,0 +1,3 @@ +# base32 + +{{ #include ../../_generated/base32-help.md }} diff --git a/docs/src/utils/base64.md b/docs/src/utils/base64.md new file mode 100644 index 000000000..6864531f8 --- /dev/null +++ b/docs/src/utils/base64.md @@ -0,0 +1,3 @@ +# base64 + +{{ #include ../../_generated/base64-help.md }} diff --git a/docs/src/utils/basename.md b/docs/src/utils/basename.md new file mode 100644 index 000000000..9a20edfd2 --- /dev/null +++ b/docs/src/utils/basename.md @@ -0,0 +1,3 @@ +# basename + +{{ #include ../../_generated/basename-help.md }} diff --git a/docs/src/utils/basenc.md b/docs/src/utils/basenc.md new file mode 100644 index 000000000..bc6721be8 --- /dev/null +++ b/docs/src/utils/basenc.md @@ -0,0 +1,3 @@ +# basenc + +{{ #include ../../_generated/basenc-help.md }} diff --git a/docs/src/utils/cat.md b/docs/src/utils/cat.md new file mode 100644 index 000000000..e8a3f02e0 --- /dev/null +++ b/docs/src/utils/cat.md @@ -0,0 +1,3 @@ +# cat + +{{ #include ../../_generated/cat-help.md }} diff --git a/docs/src/utils/chcon.md b/docs/src/utils/chcon.md new file mode 100644 index 000000000..eb416b8d2 --- /dev/null +++ b/docs/src/utils/chcon.md @@ -0,0 +1,3 @@ +# chcon + +{{ #include ../../_generated/chcon-help.md }} diff --git a/docs/src/utils/chgrp.md b/docs/src/utils/chgrp.md new file mode 100644 index 000000000..5b40501a7 --- /dev/null +++ b/docs/src/utils/chgrp.md @@ -0,0 +1,3 @@ +# chgrp + +{{ #include ../../_generated/chgrp-help.md }} diff --git a/docs/src/utils/chmod.md b/docs/src/utils/chmod.md new file mode 100644 index 000000000..91ec83f1d --- /dev/null +++ b/docs/src/utils/chmod.md @@ -0,0 +1,3 @@ +# chmod + +{{ #include ../../_generated/chmod-help.md }} diff --git a/docs/src/utils/chown.md b/docs/src/utils/chown.md new file mode 100644 index 000000000..72a4a1141 --- /dev/null +++ b/docs/src/utils/chown.md @@ -0,0 +1,3 @@ +# chown + +{{ #include ../../_generated/chown-help.md }} diff --git a/docs/src/utils/chroot.md b/docs/src/utils/chroot.md new file mode 100644 index 000000000..603c1e948 --- /dev/null +++ b/docs/src/utils/chroot.md @@ -0,0 +1,3 @@ +# chroot + +{{ #include ../../_generated/chroot-help.md }} diff --git a/docs/src/utils/cksum.md b/docs/src/utils/cksum.md new file mode 100644 index 000000000..544452d53 --- /dev/null +++ b/docs/src/utils/cksum.md @@ -0,0 +1,3 @@ +# cksum + +{{ #include ../../_generated/cksum-help.md }} diff --git a/docs/src/utils/comm.md b/docs/src/utils/comm.md new file mode 100644 index 000000000..fe3aba9b6 --- /dev/null +++ b/docs/src/utils/comm.md @@ -0,0 +1,3 @@ +# comm + +{{ #include ../../_generated/comm-help.md }} diff --git a/docs/src/utils/cp.md b/docs/src/utils/cp.md new file mode 100644 index 000000000..10b002ec8 --- /dev/null +++ b/docs/src/utils/cp.md @@ -0,0 +1,3 @@ +# cp + +{{ #include ../../_generated/cp-help.md }} diff --git a/docs/src/utils/csplit.md b/docs/src/utils/csplit.md new file mode 100644 index 000000000..897a2edfc --- /dev/null +++ b/docs/src/utils/csplit.md @@ -0,0 +1,3 @@ +# csplit + +{{ #include ../../_generated/csplit-help.md }} diff --git a/docs/src/utils/cut.md b/docs/src/utils/cut.md new file mode 100644 index 000000000..fea0f8f32 --- /dev/null +++ b/docs/src/utils/cut.md @@ -0,0 +1,3 @@ +# cut + +{{ #include ../../_generated/cut-help.md }} diff --git a/docs/src/utils/date.md b/docs/src/utils/date.md new file mode 100644 index 000000000..1c6a49131 --- /dev/null +++ b/docs/src/utils/date.md @@ -0,0 +1,3 @@ +# date + +{{ #include ../../_generated/date-help.md }} diff --git a/docs/src/utils/dd.md b/docs/src/utils/dd.md new file mode 100644 index 000000000..d74426639 --- /dev/null +++ b/docs/src/utils/dd.md @@ -0,0 +1,3 @@ +# dd + +{{ #include ../../_generated/dd-help.md }} diff --git a/docs/src/utils/df.md b/docs/src/utils/df.md new file mode 100644 index 000000000..f22e899ec --- /dev/null +++ b/docs/src/utils/df.md @@ -0,0 +1,3 @@ +# df + +{{ #include ../../_generated/df-help.md }} diff --git a/docs/src/utils/dircolors.md b/docs/src/utils/dircolors.md new file mode 100644 index 000000000..fcec2dcf8 --- /dev/null +++ b/docs/src/utils/dircolors.md @@ -0,0 +1,3 @@ +# dircolors + +{{ #include ../../_generated/dircolors-help.md }} diff --git a/docs/src/utils/dirname.md b/docs/src/utils/dirname.md new file mode 100644 index 000000000..bc86fc999 --- /dev/null +++ b/docs/src/utils/dirname.md @@ -0,0 +1,3 @@ +# dirname + +{{ #include ../../_generated/dirname-help.md }} diff --git a/docs/src/utils/du.md b/docs/src/utils/du.md new file mode 100644 index 000000000..79236368c --- /dev/null +++ b/docs/src/utils/du.md @@ -0,0 +1,3 @@ +# du + +{{ #include ../../_generated/du-help.md }} diff --git a/docs/src/utils/echo.md b/docs/src/utils/echo.md new file mode 100644 index 000000000..fb86a0533 --- /dev/null +++ b/docs/src/utils/echo.md @@ -0,0 +1,3 @@ +# echo + +{{ #include ../../_generated/echo-help.md }} diff --git a/docs/src/utils/env.md b/docs/src/utils/env.md new file mode 100644 index 000000000..bbe828a81 --- /dev/null +++ b/docs/src/utils/env.md @@ -0,0 +1,3 @@ +# env + +{{ #include ../../_generated/env-help.md }} diff --git a/docs/src/utils/expand.md b/docs/src/utils/expand.md new file mode 100644 index 000000000..56c930b06 --- /dev/null +++ b/docs/src/utils/expand.md @@ -0,0 +1,3 @@ +# expand + +{{ #include ../../_generated/expand-help.md }} diff --git a/docs/src/utils/expr.md b/docs/src/utils/expr.md new file mode 100644 index 000000000..67914a6f3 --- /dev/null +++ b/docs/src/utils/expr.md @@ -0,0 +1,3 @@ +# expr + +{{ #include ../../_generated/expr-help.md }} diff --git a/docs/src/utils/factor.md b/docs/src/utils/factor.md new file mode 100644 index 000000000..a135ace83 --- /dev/null +++ b/docs/src/utils/factor.md @@ -0,0 +1,3 @@ +# factor + +{{ #include ../../_generated/factor-help.md }} diff --git a/docs/src/utils/false.md b/docs/src/utils/false.md new file mode 100644 index 000000000..0dcf26133 --- /dev/null +++ b/docs/src/utils/false.md @@ -0,0 +1,3 @@ +# false + +{{ #include ../../_generated/false-help.md }} diff --git a/docs/src/utils/fmt.md b/docs/src/utils/fmt.md new file mode 100644 index 000000000..10c987500 --- /dev/null +++ b/docs/src/utils/fmt.md @@ -0,0 +1,3 @@ +# fmt + +{{ #include ../../_generated/fmt-help.md }} diff --git a/docs/src/utils/fold.md b/docs/src/utils/fold.md new file mode 100644 index 000000000..8b41ed45d --- /dev/null +++ b/docs/src/utils/fold.md @@ -0,0 +1,3 @@ +# fold + +{{ #include ../../_generated/fold-help.md }} diff --git a/docs/src/utils/groups.md b/docs/src/utils/groups.md new file mode 100644 index 000000000..84c1e4dea --- /dev/null +++ b/docs/src/utils/groups.md @@ -0,0 +1,3 @@ +# groups + +{{ #include ../../_generated/groups-help.md }} diff --git a/docs/src/utils/hashsum.md b/docs/src/utils/hashsum.md new file mode 100644 index 000000000..76fe432db --- /dev/null +++ b/docs/src/utils/hashsum.md @@ -0,0 +1,3 @@ +# hashsum + +{{ #include ../../_generated/hashsum-help.md }} diff --git a/docs/src/utils/head.md b/docs/src/utils/head.md new file mode 100644 index 000000000..5b9a6dd75 --- /dev/null +++ b/docs/src/utils/head.md @@ -0,0 +1,3 @@ +# head + +{{ #include ../../_generated/head-help.md }} diff --git a/docs/src/utils/hostid.md b/docs/src/utils/hostid.md new file mode 100644 index 000000000..162557ce7 --- /dev/null +++ b/docs/src/utils/hostid.md @@ -0,0 +1,3 @@ +# hostid + +{{ #include ../../_generated/hostid-help.md }} diff --git a/docs/src/utils/hostname.md b/docs/src/utils/hostname.md new file mode 100644 index 000000000..24865db59 --- /dev/null +++ b/docs/src/utils/hostname.md @@ -0,0 +1,3 @@ +# hostname + +{{ #include ../../_generated/hostname-help.md }} diff --git a/docs/src/utils/id.md b/docs/src/utils/id.md new file mode 100644 index 000000000..9b850a470 --- /dev/null +++ b/docs/src/utils/id.md @@ -0,0 +1,3 @@ +# id + +{{ #include ../../_generated/id-help.md }} diff --git a/docs/src/utils/index.md b/docs/src/utils/index.md new file mode 100644 index 000000000..9a0c312f1 --- /dev/null +++ b/docs/src/utils/index.md @@ -0,0 +1,102 @@ +# Utils + +* [arch](./arch.md) +* [base32](./base32.md) +* [base64](./base64.md) +* [basename](./basename.md) +* [basenc](./basenc.md) +* [cat](./cat.md) +* [chcon](./chcon.md) +* [chgrp](./chgrp.md) +* [chmod](./chmod.md) +* [chown](./chown.md) +* [chroot](./chroot.md) +* [cksum](./cksum.md) +* [comm](./comm.md) +* [cp](./cp.md) +* [csplit](./csplit.md) +* [cut](./cut.md) +* [date](./date.md) +* [dd](./dd.md) +* [df](./df.md) +* [dircolors](./dircolors.md) +* [dirname](./dirname.md) +* [du](./du.md) +* [echo](./echo.md) +* [env](./env.md) +* [expand](./expand.md) +* [expr](./expr.md) +* [factor](./factor.md) +* [false](./false.md) +* [fmt](./fmt.md) +* [fold](./fold.md) +* [groups](./groups.md) +* [hashsum](./hashsum.md) +* [head](./head.md) +* [hostid](./hostid.md) +* [hostname](./hostname.md) +* [id](./id.md) +* [install](./install.md) +* [join](./join.md) +* [kill](./kill.md) +* [link](./link.md) +* [ln](./ln.md) +* [logname](./logname.md) +* [ls](./ls.md) +* [mkdir](./mkdir.md) +* [mkfifo](./mkfifo.md) +* [mknod](./mknod.md) +* [mktemp](./mktemp.md) +* [more](./more.md) +* [mv](./mv.md) +* [nice](./nice.md) +* [nl](./nl.md) +* [nohup](./nohup.md) +* [nproc](./nproc.md) +* [numfmt](./numfmt.md) +* [od](./od.md) +* [paste](./paste.md) +* [pathchk](./pathchk.md) +* [pinky](./pinky.md) +* [pr](./pr.md) +* [printenv](./printenv.md) +* [printf](./printf.md) +* [ptx](./ptx.md) +* [pwd](./pwd.md) +* [readlink](./readlink.md) +* [realpath](./realpath.md) +* [relpath](./relpath.md) +* [rm](./rm.md) +* [rmdir](./rmdir.md) +* [runcon](./runcon.md) +* [seq](./seq.md) +* [shred](./shred.md) +* [shuf](./shuf.md) +* [sleep](./sleep.md) +* [sort](./sort.md) +* [split](./split.md) +* [stat](./stat.md) +* [stdbuf](./stdbuf.md) +* [sum](./sum.md) +* [sync](./sync.md) +* [tac](./tac.md) +* [tail](./tail.md) +* [tee](./tee.md) +* [test](./test.md) +* [timeout](./timeout.md) +* [touch](./touch.md) +* [tr](./tr.md) +* [true](./true.md) +* [truncate](./truncate.md) +* [tsort](./tsort.md) +* [tty](./tty.md) +* [uname](./uname.md) +* [unexpand](./unexpand.md) +* [uniq](./uniq.md) +* [unlink](./unlink.md) +* [uptime](./uptime.md) +* [users](./users.md) +* [wc](./wc.md) +* [who](./who.md) +* [whoami](./whoami.md) +* [yes](./yes.md) diff --git a/docs/src/utils/install.md b/docs/src/utils/install.md new file mode 100644 index 000000000..3c91e59f4 --- /dev/null +++ b/docs/src/utils/install.md @@ -0,0 +1,3 @@ +# install + +{{ #include ../../_generated/install-help.md }} diff --git a/docs/src/utils/join.md b/docs/src/utils/join.md new file mode 100644 index 000000000..1f386e271 --- /dev/null +++ b/docs/src/utils/join.md @@ -0,0 +1,3 @@ +# join + +{{ #include ../../_generated/join-help.md }} diff --git a/docs/src/utils/kill.md b/docs/src/utils/kill.md new file mode 100644 index 000000000..8120c21bc --- /dev/null +++ b/docs/src/utils/kill.md @@ -0,0 +1,3 @@ +# kill + +{{ #include ../../_generated/kill-help.md }} diff --git a/docs/src/utils/link.md b/docs/src/utils/link.md new file mode 100644 index 000000000..8a9666eef --- /dev/null +++ b/docs/src/utils/link.md @@ -0,0 +1,3 @@ +# link + +{{ #include ../../_generated/link-help.md }} diff --git a/docs/src/utils/ln.md b/docs/src/utils/ln.md new file mode 100644 index 000000000..b8722a550 --- /dev/null +++ b/docs/src/utils/ln.md @@ -0,0 +1,3 @@ +# ln + +{{ #include ../../_generated/ln-help.md }} diff --git a/docs/src/utils/logname.md b/docs/src/utils/logname.md new file mode 100644 index 000000000..3d9aadb52 --- /dev/null +++ b/docs/src/utils/logname.md @@ -0,0 +1,3 @@ +# logname + +{{ #include ../../_generated/logname-help.md }} diff --git a/docs/src/utils/ls.md b/docs/src/utils/ls.md new file mode 100644 index 000000000..8476a4772 --- /dev/null +++ b/docs/src/utils/ls.md @@ -0,0 +1,3 @@ +# ls + +{{ #include ../../_generated/ls-help.md }} diff --git a/docs/src/utils/mkdir.md b/docs/src/utils/mkdir.md new file mode 100644 index 000000000..896f6e933 --- /dev/null +++ b/docs/src/utils/mkdir.md @@ -0,0 +1,3 @@ +# mkdir + +{{ #include ../../_generated/mkdir-help.md }} diff --git a/docs/src/utils/mkfifo.md b/docs/src/utils/mkfifo.md new file mode 100644 index 000000000..7b7514722 --- /dev/null +++ b/docs/src/utils/mkfifo.md @@ -0,0 +1,3 @@ +# mkfifo + +{{ #include ../../_generated/mkfifo-help.md }} diff --git a/docs/src/utils/mknod.md b/docs/src/utils/mknod.md new file mode 100644 index 000000000..e5c44b883 --- /dev/null +++ b/docs/src/utils/mknod.md @@ -0,0 +1,3 @@ +# mknod + +{{ #include ../../_generated/mknod-help.md }} diff --git a/docs/src/utils/mktemp.md b/docs/src/utils/mktemp.md new file mode 100644 index 000000000..445dc6872 --- /dev/null +++ b/docs/src/utils/mktemp.md @@ -0,0 +1,3 @@ +# mktemp + +{{ #include ../../_generated/mktemp-help.md }} diff --git a/docs/src/utils/more.md b/docs/src/utils/more.md new file mode 100644 index 000000000..209832840 --- /dev/null +++ b/docs/src/utils/more.md @@ -0,0 +1,3 @@ +# more + +{{ #include ../../_generated/more-help.md }} diff --git a/docs/src/utils/mv.md b/docs/src/utils/mv.md new file mode 100644 index 000000000..7e72d9c6d --- /dev/null +++ b/docs/src/utils/mv.md @@ -0,0 +1,3 @@ +# mv + +{{ #include ../../_generated/mv-help.md }} diff --git a/docs/src/utils/nice.md b/docs/src/utils/nice.md new file mode 100644 index 000000000..ab304bff0 --- /dev/null +++ b/docs/src/utils/nice.md @@ -0,0 +1,3 @@ +# nice + +{{ #include ../../_generated/nice-help.md }} diff --git a/docs/src/utils/nl.md b/docs/src/utils/nl.md new file mode 100644 index 000000000..b1f24f064 --- /dev/null +++ b/docs/src/utils/nl.md @@ -0,0 +1,3 @@ +# nl + +{{ #include ../../_generated/nl-help.md }} diff --git a/docs/src/utils/nohup.md b/docs/src/utils/nohup.md new file mode 100644 index 000000000..367254bee --- /dev/null +++ b/docs/src/utils/nohup.md @@ -0,0 +1,3 @@ +# nohup + +{{ #include ../../_generated/nohup-help.md }} diff --git a/docs/src/utils/nproc.md b/docs/src/utils/nproc.md new file mode 100644 index 000000000..b4ef4eaa4 --- /dev/null +++ b/docs/src/utils/nproc.md @@ -0,0 +1,3 @@ +# nproc + +{{ #include ../../_generated/nproc-help.md }} diff --git a/docs/src/utils/numfmt.md b/docs/src/utils/numfmt.md new file mode 100644 index 000000000..f811efbaa --- /dev/null +++ b/docs/src/utils/numfmt.md @@ -0,0 +1,3 @@ +# numfmt + +{{ #include ../../_generated/numfmt-help.md }} diff --git a/docs/src/utils/od.md b/docs/src/utils/od.md new file mode 100644 index 000000000..8b366b8fd --- /dev/null +++ b/docs/src/utils/od.md @@ -0,0 +1,3 @@ +# od + +{{ #include ../../_generated/od-help.md }} diff --git a/docs/src/utils/paste.md b/docs/src/utils/paste.md new file mode 100644 index 000000000..86038f1a8 --- /dev/null +++ b/docs/src/utils/paste.md @@ -0,0 +1,3 @@ +# paste + +{{ #include ../../_generated/paste-help.md }} diff --git a/docs/src/utils/pathchk.md b/docs/src/utils/pathchk.md new file mode 100644 index 000000000..f04139eec --- /dev/null +++ b/docs/src/utils/pathchk.md @@ -0,0 +1,3 @@ +# pathchk + +{{ #include ../../_generated/pathchk-help.md }} diff --git a/docs/src/utils/pinky.md b/docs/src/utils/pinky.md new file mode 100644 index 000000000..1efe4ff45 --- /dev/null +++ b/docs/src/utils/pinky.md @@ -0,0 +1,3 @@ +# pinky + +{{ #include ../../_generated/pinky-help.md }} diff --git a/docs/src/utils/pr.md b/docs/src/utils/pr.md new file mode 100644 index 000000000..82b9c938d --- /dev/null +++ b/docs/src/utils/pr.md @@ -0,0 +1,3 @@ +# pr + +{{ #include ../../_generated/pr-help.md }} diff --git a/docs/src/utils/printenv.md b/docs/src/utils/printenv.md new file mode 100644 index 000000000..5543f1e13 --- /dev/null +++ b/docs/src/utils/printenv.md @@ -0,0 +1,3 @@ +# printenv + +{{ #include ../../_generated/printenv-help.md }} diff --git a/docs/src/utils/printf.md b/docs/src/utils/printf.md new file mode 100644 index 000000000..e11fff3df --- /dev/null +++ b/docs/src/utils/printf.md @@ -0,0 +1,3 @@ +# printf + +{{ #include ../../_generated/printf-help.md }} diff --git a/docs/src/utils/ptx.md b/docs/src/utils/ptx.md new file mode 100644 index 000000000..e755a058d --- /dev/null +++ b/docs/src/utils/ptx.md @@ -0,0 +1,3 @@ +# ptx + +{{ #include ../../_generated/ptx-help.md }} diff --git a/docs/src/utils/pwd.md b/docs/src/utils/pwd.md new file mode 100644 index 000000000..b3122b336 --- /dev/null +++ b/docs/src/utils/pwd.md @@ -0,0 +1,3 @@ +# pwd + +{{ #include ../../_generated/pwd-help.md }} diff --git a/docs/src/utils/readlink.md b/docs/src/utils/readlink.md new file mode 100644 index 000000000..56db08517 --- /dev/null +++ b/docs/src/utils/readlink.md @@ -0,0 +1,3 @@ +# readlink + +{{ #include ../../_generated/readlink-help.md }} diff --git a/docs/src/utils/realpath.md b/docs/src/utils/realpath.md new file mode 100644 index 000000000..22bc83475 --- /dev/null +++ b/docs/src/utils/realpath.md @@ -0,0 +1,3 @@ +# realpath + +{{ #include ../../_generated/realpath-help.md }} diff --git a/docs/src/utils/relpath.md b/docs/src/utils/relpath.md new file mode 100644 index 000000000..51acd2c87 --- /dev/null +++ b/docs/src/utils/relpath.md @@ -0,0 +1,3 @@ +# relpath + +{{ #include ../../_generated/relpath-help.md }} diff --git a/docs/src/utils/rm.md b/docs/src/utils/rm.md new file mode 100644 index 000000000..dfb24f242 --- /dev/null +++ b/docs/src/utils/rm.md @@ -0,0 +1,3 @@ +# rm + +{{ #include ../../_generated/rm-help.md }} diff --git a/docs/src/utils/rmdir.md b/docs/src/utils/rmdir.md new file mode 100644 index 000000000..1c8d5f205 --- /dev/null +++ b/docs/src/utils/rmdir.md @@ -0,0 +1,3 @@ +# rmdir + +{{ #include ../../_generated/rmdir-help.md }} diff --git a/docs/src/utils/runcon.md b/docs/src/utils/runcon.md new file mode 100644 index 000000000..011361492 --- /dev/null +++ b/docs/src/utils/runcon.md @@ -0,0 +1,3 @@ +# runcon + +{{ #include ../../_generated/runcon-help.md }} diff --git a/docs/src/utils/seq.md b/docs/src/utils/seq.md new file mode 100644 index 000000000..23fdf04cf --- /dev/null +++ b/docs/src/utils/seq.md @@ -0,0 +1,3 @@ +# seq + +{{ #include ../../_generated/seq-help.md }} diff --git a/docs/src/utils/shred.md b/docs/src/utils/shred.md new file mode 100644 index 000000000..4eae89785 --- /dev/null +++ b/docs/src/utils/shred.md @@ -0,0 +1,3 @@ +# shred + +{{ #include ../../_generated/shred-help.md }} diff --git a/docs/src/utils/shuf.md b/docs/src/utils/shuf.md new file mode 100644 index 000000000..1d898ef65 --- /dev/null +++ b/docs/src/utils/shuf.md @@ -0,0 +1,3 @@ +# shuf + +{{ #include ../../_generated/shuf-help.md }} diff --git a/docs/src/utils/sleep.md b/docs/src/utils/sleep.md new file mode 100644 index 000000000..c115868b3 --- /dev/null +++ b/docs/src/utils/sleep.md @@ -0,0 +1,3 @@ +# sleep + +{{ #include ../../_generated/sleep-help.md }} diff --git a/docs/src/utils/sort.md b/docs/src/utils/sort.md new file mode 100644 index 000000000..7b66f920f --- /dev/null +++ b/docs/src/utils/sort.md @@ -0,0 +1,3 @@ +# sort + +{{ #include ../../_generated/sort-help.md }} diff --git a/docs/src/utils/split.md b/docs/src/utils/split.md new file mode 100644 index 000000000..0aa795247 --- /dev/null +++ b/docs/src/utils/split.md @@ -0,0 +1,3 @@ +# split + +{{ #include ../../_generated/split-help.md }} diff --git a/docs/src/utils/stat.md b/docs/src/utils/stat.md new file mode 100644 index 000000000..deb2c57d2 --- /dev/null +++ b/docs/src/utils/stat.md @@ -0,0 +1,3 @@ +# stat + +{{ #include ../../_generated/stat-help.md }} diff --git a/docs/src/utils/stdbuf.md b/docs/src/utils/stdbuf.md new file mode 100644 index 000000000..d13c3ece0 --- /dev/null +++ b/docs/src/utils/stdbuf.md @@ -0,0 +1,3 @@ +# stdbuf + +{{ #include ../../_generated/stdbuf-help.md }} diff --git a/docs/src/utils/sum.md b/docs/src/utils/sum.md new file mode 100644 index 000000000..2475c2d65 --- /dev/null +++ b/docs/src/utils/sum.md @@ -0,0 +1,3 @@ +# sum + +{{ #include ../../_generated/sum-help.md }} diff --git a/docs/src/utils/sync.md b/docs/src/utils/sync.md new file mode 100644 index 000000000..5a8d393bd --- /dev/null +++ b/docs/src/utils/sync.md @@ -0,0 +1,3 @@ +# sync + +{{ #include ../../_generated/sync-help.md }} diff --git a/docs/src/utils/tac.md b/docs/src/utils/tac.md new file mode 100644 index 000000000..914f2d372 --- /dev/null +++ b/docs/src/utils/tac.md @@ -0,0 +1,3 @@ +# tac + +{{ #include ../../_generated/tac-help.md }} diff --git a/docs/src/utils/tail.md b/docs/src/utils/tail.md new file mode 100644 index 000000000..35863797e --- /dev/null +++ b/docs/src/utils/tail.md @@ -0,0 +1,3 @@ +# tail + +{{ #include ../../_generated/tail-help.md }} diff --git a/docs/src/utils/tee.md b/docs/src/utils/tee.md new file mode 100644 index 000000000..b845a75e5 --- /dev/null +++ b/docs/src/utils/tee.md @@ -0,0 +1,3 @@ +# tee + +{{ #include ../../_generated/tee-help.md }} diff --git a/docs/src/utils/test.md b/docs/src/utils/test.md new file mode 100644 index 000000000..e02ba1157 --- /dev/null +++ b/docs/src/utils/test.md @@ -0,0 +1,3 @@ +# test + +{{ #include ../../_generated/test-help.md }} diff --git a/docs/src/utils/timeout.md b/docs/src/utils/timeout.md new file mode 100644 index 000000000..d870fa1af --- /dev/null +++ b/docs/src/utils/timeout.md @@ -0,0 +1,3 @@ +# timeout + +{{ #include ../../_generated/timeout-help.md }} diff --git a/docs/src/utils/touch.md b/docs/src/utils/touch.md new file mode 100644 index 000000000..d68b4f6e9 --- /dev/null +++ b/docs/src/utils/touch.md @@ -0,0 +1,3 @@ +# touch + +{{ #include ../../_generated/touch-help.md }} diff --git a/docs/src/utils/tr.md b/docs/src/utils/tr.md new file mode 100644 index 000000000..39fbfcf6c --- /dev/null +++ b/docs/src/utils/tr.md @@ -0,0 +1,3 @@ +# tr + +{{ #include ../../_generated/tr-help.md }} diff --git a/docs/src/utils/true.md b/docs/src/utils/true.md new file mode 100644 index 000000000..c3448c906 --- /dev/null +++ b/docs/src/utils/true.md @@ -0,0 +1,3 @@ +# true + +{{ #include ../../_generated/true-help.md }} diff --git a/docs/src/utils/truncate.md b/docs/src/utils/truncate.md new file mode 100644 index 000000000..402d56d68 --- /dev/null +++ b/docs/src/utils/truncate.md @@ -0,0 +1,3 @@ +# truncate + +{{ #include ../../_generated/truncate-help.md }} diff --git a/docs/src/utils/tsort.md b/docs/src/utils/tsort.md new file mode 100644 index 000000000..a418fa4e7 --- /dev/null +++ b/docs/src/utils/tsort.md @@ -0,0 +1,3 @@ +# tsort + +{{ #include ../../_generated/tsort-help.md }} diff --git a/docs/src/utils/tty.md b/docs/src/utils/tty.md new file mode 100644 index 000000000..2c1da1c47 --- /dev/null +++ b/docs/src/utils/tty.md @@ -0,0 +1,3 @@ +# tty + +{{ #include ../../_generated/tty-help.md }} diff --git a/docs/src/utils/uname.md b/docs/src/utils/uname.md new file mode 100644 index 000000000..1436d5599 --- /dev/null +++ b/docs/src/utils/uname.md @@ -0,0 +1,3 @@ +# uname + +{{ #include ../../_generated/uname-help.md }} diff --git a/docs/src/utils/unexpand.md b/docs/src/utils/unexpand.md new file mode 100644 index 000000000..05a2b33b8 --- /dev/null +++ b/docs/src/utils/unexpand.md @@ -0,0 +1,3 @@ +# unexpand + +{{ #include ../../_generated/unexpand-help.md }} diff --git a/docs/src/utils/uniq.md b/docs/src/utils/uniq.md new file mode 100644 index 000000000..f9f561e32 --- /dev/null +++ b/docs/src/utils/uniq.md @@ -0,0 +1,3 @@ +# uniq + +{{ #include ../../_generated/uniq-help.md }} diff --git a/docs/src/utils/unlink.md b/docs/src/utils/unlink.md new file mode 100644 index 000000000..5888bb2a8 --- /dev/null +++ b/docs/src/utils/unlink.md @@ -0,0 +1,3 @@ +# unlink + +{{ #include ../../_generated/unlink-help.md }} diff --git a/docs/src/utils/uptime.md b/docs/src/utils/uptime.md new file mode 100644 index 000000000..336a5edd9 --- /dev/null +++ b/docs/src/utils/uptime.md @@ -0,0 +1,3 @@ +# uptime + +{{ #include ../../_generated/uptime-help.md }} diff --git a/docs/src/utils/users.md b/docs/src/utils/users.md new file mode 100644 index 000000000..de20c96ed --- /dev/null +++ b/docs/src/utils/users.md @@ -0,0 +1,3 @@ +# users + +{{ #include ../../_generated/users-help.md }} diff --git a/docs/src/utils/wc.md b/docs/src/utils/wc.md new file mode 100644 index 000000000..c5fffdeab --- /dev/null +++ b/docs/src/utils/wc.md @@ -0,0 +1,3 @@ +# wc + +{{ #include ../../_generated/wc-help.md }} diff --git a/docs/src/utils/who.md b/docs/src/utils/who.md new file mode 100644 index 000000000..9cd7f5ba7 --- /dev/null +++ b/docs/src/utils/who.md @@ -0,0 +1,3 @@ +# who + +{{ #include ../../_generated/who-help.md }} diff --git a/docs/src/utils/whoami.md b/docs/src/utils/whoami.md new file mode 100644 index 000000000..4e896a30a --- /dev/null +++ b/docs/src/utils/whoami.md @@ -0,0 +1,3 @@ +# whoami + +{{ #include ../../_generated/whoami-help.md }} diff --git a/docs/src/utils/yes.md b/docs/src/utils/yes.md new file mode 100644 index 000000000..fbf18307a --- /dev/null +++ b/docs/src/utils/yes.md @@ -0,0 +1,3 @@ +# yes + +{{ #include ../../_generated/yes-help.md }} diff --git a/docs/uutils.rst b/docs/uutils.rst deleted file mode 100644 index e3b8c6a1a..000000000 --- a/docs/uutils.rst +++ /dev/null @@ -1,24 +0,0 @@ -.. run core utilities - -====== -uutils -====== - -.. FIXME: this needs to be autogenerated somehow - --------- -Synopsis --------- - -``uutils`` [OPTION]... [PROGRAM] [OPTION]... [ARGUMENTS]... - ------------ -Description ------------ - -``uutils`` is a program that contains other coreutils commands, somewhat -similar to Busybox. - ---help, -h print a help menu for PROGRAM displaying accepted options and - arguments; if PROGRAM was not given, do the same but for this - program diff --git a/src/bin/uudoc.rs b/src/bin/uudoc.rs index 65da4c7cc..ce51e8833 100644 --- a/src/bin/uudoc.rs +++ b/src/bin/uudoc.rs @@ -6,109 +6,64 @@ // file that was distributed with this source code. use clap::App; -use clap::Arg; -use clap::Shell; -use std::cmp; use std::collections::hash_map::HashMap; -use std::ffi::OsStr; use std::ffi::OsString; -use std::io::{self, Write}; -use std::path::{Path, PathBuf}; -use std::process; -use uucore::display::Quotable; - -const VERSION: &str = env!("CARGO_PKG_VERSION"); +use std::fs::File; +use std::io::Write; include!(concat!(env!("OUT_DIR"), "/uutils_map.rs")); -fn usage(utils: &UtilityMap, name: &str) { - println!("{} {}\n", name, VERSION); - println!("Generate markdown documentation for uutils"); - println!("Usage: {} [util]\n", name); - println!("Currently defined functions:\n"); - #[allow(clippy::map_clone)] - let mut utils: Vec<&str> = utils.keys().map(|&s| s).collect(); - utils.sort_unstable(); - let display_list = utils.join(", "); - let width = cmp::min(textwrap::termwidth(), 100) - 4 * 2; // (opinion/heuristic) max 100 chars wide with 4 character side indentions - println!( - "{}", - textwrap::indent(&textwrap::fill(&display_list, width), " ") - ); -} - -fn binary_path(args: &mut impl Iterator) -> PathBuf { - match args.next() { - Some(ref s) if !s.is_empty() => PathBuf::from(s), - _ => std::env::current_exe().unwrap(), - } -} - -fn name(binary_path: &Path) -> &str { - binary_path.file_stem().unwrap().to_str().unwrap() -} - fn main() { uucore::panic::mute_sigpipe_panic(); - let utils = util_map(); - let mut args = uucore::args_os(); + let utils = util_map::>>(); - let binary = binary_path(&mut args); - let binary_as_util = name(&binary); - - // binary name equals util name? - if let Some(&(uumain, _)) = utils.get(binary_as_util) { - process::exit(uumain((vec![binary.into()].into_iter()).chain(args))); - } - - // binary name equals prefixed util name? - // * prefix/stem may be any string ending in a non-alphanumeric character - let util_name = if let Some(util) = utils.keys().find(|util| { - binary_as_util.ends_with(*util) - && !(&binary_as_util[..binary_as_util.len() - (*util).len()]) - .ends_with(char::is_alphanumeric) - }) { - // prefixed util => replace 0th (aka, executable name) argument - Some(OsString::from(*util)) - } else { - // unmatched binary name => regard as multi-binary container and advance argument list - uucore::set_utility_is_second_arg(); - args.next() - }; - - // 0th argument equals util name? - if let Some(util_os) = util_name { - fn not_found(util: &OsStr) -> ! { - println!("{}: function/utility not found", util.maybe_quote()); - process::exit(1); + for (name, (_, app)) in utils { + let p = format!("docs/_generated/{}-help.md", name); + if let Ok(f) = File::create(&p) { + write_markdown(f, &mut app()); + println!("Wrote to '{}'", p); } - - let util = match util_os.to_str() { - Some(util) => util, - None => not_found(&util_os), - }; - - match utils.get(util) { - Some(&(uumain, app)) => { - print_markdown(app); - } - None => { - if util == "--help" || util == "-h" { - usage(&utils, binary_as_util); - process::exit(0); - } else { - not_found(&util_os); - } - } - } - } else { - // no arguments provided - usage(&utils, binary_as_util); - process::exit(0); } } -fn print_markdown(app: &App) { - for arg in app.get_arguments() {} +fn write_markdown(mut w: impl Write, app: &mut App) { + write_summary(&mut w, app); + write_options(&mut w, app); +} + +fn write_summary(w: &mut impl Write, app: &App) { + if let Some(about) = app.get_long_about().or_else(|| app.get_about()) { + let _ = writeln!(w, "

Summary

"); + let _ = writeln!(w, "{}", about); + } +} + +fn write_options(w: &mut impl Write, app: &App) { + let _ = writeln!(w, "

Options

"); + let _ = write!(w, "
"); + for arg in app.get_arguments() { + let _ = write!(w, "
"); + let mut first = true; + for l in arg.get_long_and_visible_aliases().unwrap_or_default() { + if !first { + let _ = write!(w, ", "); + } else { + first = false; + } + let _ = write!(w, "--{}", l); + } + for l in arg.get_short_and_visible_aliases().unwrap_or_default() { + if !first { + let _ = write!(w, ", "); + } else { + first = false; + } + let _ = write!(w, "-{}", l); + } + let _ = writeln!(w, "
"); + + let _ = writeln!(w, "
{}
", arg.get_help().unwrap_or_default()); + } + let _ = writeln!(w, "
"); } From 68c584fef6dd91071a3250282b300d884c7e924c Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Thu, 20 Jan 2022 18:41:07 +0100 Subject: [PATCH 03/15] docs: adjust space for options --- docs/theme/head.hbs | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 docs/theme/head.hbs diff --git a/docs/theme/head.hbs b/docs/theme/head.hbs new file mode 100644 index 000000000..2d481cdac --- /dev/null +++ b/docs/theme/head.hbs @@ -0,0 +1,5 @@ + \ No newline at end of file From a903fee5692a09e60a770ae8feb86b716da597a9 Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Thu, 20 Jan 2022 21:02:44 +0100 Subject: [PATCH 04/15] docs: favicon, installation instructions, better introduction page --- docs/CONTRIBUTING.html | 185 -------------------------------- docs/CONTRIBUTING.md | 1 - docs/book.toml | 2 +- docs/create_docs.py | 2 +- docs/src/SUMMARY.md | 3 +- docs/src/index.md | 20 ++++ docs/src/installation.md | 223 +++++++++++++++++++++++++++++++++++++++ docs/src/introduction.md | 8 -- docs/theme/favicon.png | Bin 0 -> 13227 bytes 9 files changed, 247 insertions(+), 197 deletions(-) delete mode 100644 docs/CONTRIBUTING.html delete mode 100644 docs/CONTRIBUTING.md create mode 100644 docs/src/index.md create mode 100644 docs/src/installation.md delete mode 100644 docs/src/introduction.md create mode 100644 docs/theme/favicon.png diff --git a/docs/CONTRIBUTING.html b/docs/CONTRIBUTING.html deleted file mode 100644 index 80098ad2d..000000000 --- a/docs/CONTRIBUTING.html +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - Contributing - Uutils Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - -
-
-

Contributing

- -
- - -
-
- - - -
- - - - - - - - - - - - - - diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md deleted file mode 100644 index 854139a31..000000000 --- a/docs/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -# Contributing diff --git a/docs/book.toml b/docs/book.toml index 10e64f3c9..75982ab31 100644 --- a/docs/book.toml +++ b/docs/book.toml @@ -3,7 +3,7 @@ authors = ["uutils contributors"] language = "en" multilingual = false src = "src" -title = "Uutils Documentation" +title = "uutils Documentation" [output.html] git-repository-url = "https://github.com/rust-lang/cargo/tree/master/src/doc/src" \ No newline at end of file diff --git a/docs/create_docs.py b/docs/create_docs.py index b07b851fa..6fd9314a4 100644 --- a/docs/create_docs.py +++ b/docs/create_docs.py @@ -7,7 +7,7 @@ import os with open('src/utils/index.md', 'w') as index: with open('src/SUMMARY.md', 'w') as summary: summary.write("# Summary\n\n") - summary.write("* [Introduction](introduction.md)\n") + summary.write("[Introduction](index.md)\n") summary.write("* [Contributing](contributing.md)\n") summary.write("* [Utils](utils/index.md)\n") index.write("# Utils\n\n") diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index bc595000a..1364134b1 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -1,6 +1,7 @@ # Summary -* [Introduction](introduction.md) +[Introduction](index.md) +* [Installation](installation.md) * [Contributing](contributing.md) * [Utils](utils/index.md) * [arch](utils/arch.md) diff --git a/docs/src/index.md b/docs/src/index.md new file mode 100644 index 000000000..23cc0d9af --- /dev/null +++ b/docs/src/index.md @@ -0,0 +1,20 @@ +# uutils Coreutils Documentation + +uutils is an attempt at writing universal (as in cross-platform) CLI +utilities in [Rust](https://www.rust-lang.org). It is available for +Linux, Windows, Mac and other platforms. + +The API reference for `uucore`, the library of functions shared between +various utils, is hosted at at +[docs.rs](https://docs.rs/uucore/0.0.10/uucore/). + +uutils is licensed under the [MIT License](https://github.com/uutils/coreutils/LICENSE.md). + +## Useful links +* [Releases](https://github.com/uutils/coreutils/releases) +* [Source Code](https://github.com/uutils/coreutils) +* [Issues](https://github.com/uutils/coreutils/issues) +* [Discord](https://discord.gg/wQVJbvJ) + +> Note: This manual is automatically generated from the source code and is +> a work in progress. \ No newline at end of file diff --git a/docs/src/installation.md b/docs/src/installation.md new file mode 100644 index 000000000..5b604c9da --- /dev/null +++ b/docs/src/installation.md @@ -0,0 +1,223 @@ +# Installation + +## Requirements + +* Rust (`cargo`, `rustc`) +* GNU Make (optional) + +### Rust Version + +uutils follows Rust's release channels and is tested against stable, beta and nightly. +The current oldest supported version of the Rust compiler is `1.54`. + +On both Windows and Redox, only the nightly version is tested currently. + +## Build Instructions + +There are currently two methods to build the uutils binaries: either Cargo +or GNU Make. + +> Building the full package, including all documentation, requires both Cargo +> and Gnu Make on a Unix platform. + +For either method, we first need to fetch the repository: + +```bash +$ git clone https://github.com/uutils/coreutils +$ cd coreutils +``` + +### Cargo + +Building uutils using Cargo is easy because the process is the same as for +every other Rust program: + +```bash +$ cargo build --release +``` + +This command builds the most portable common core set of uutils into a multicall +(BusyBox-type) binary, named 'coreutils', on most Rust-supported platforms. + +Additional platform-specific uutils are often available. Building these +expanded sets of uutils for a platform (on that platform) is as simple as +specifying it as a feature: + +```bash +$ cargo build --release --features macos +# or ... +$ cargo build --release --features windows +# or ... +$ cargo build --release --features unix +``` + +If you don't want to build every utility available on your platform into the +final binary, you can also specify which ones you want to build manually. +For example: + +```bash +$ cargo build --features "base32 cat echo rm" --no-default-features +``` + +If you don't want to build the multicall binary and would prefer to build +the utilities as individual binaries, that is also possible. Each utility +is contained in its own package within the main repository, named +"uu_UTILNAME". To build individual utilities, use cargo to build just the +specific packages (using the `--package` [aka `-p`] option). For example: + +```bash +$ cargo build -p uu_base32 -p uu_cat -p uu_echo -p uu_rm +``` + +### GNU Make + +Building using `make` is a simple process as well. + +To simply build all available utilities: + +```bash +$ make +``` + +To build all but a few of the available utilities: + +```bash +$ make SKIP_UTILS='UTILITY_1 UTILITY_2' +``` + +To build only a few of the available utilities: + +```bash +$ make UTILS='UTILITY_1 UTILITY_2' +``` + +## Installation Instructions + +### Cargo + +Likewise, installing can simply be done using: + +```bash +$ cargo install --path . +``` + +This command will install uutils into Cargo's *bin* folder (*e.g.* `$HOME/.cargo/bin`). + +This does not install files necessary for shell completion. For shell completion to work, +use `GNU Make` or see `Manually install shell completions`. + +### GNU Make + +To install all available utilities: + +```bash +$ make install +``` + +To install using `sudo` switch `-E` must be used: + +```bash +$ sudo -E make install +``` + +To install all but a few of the available utilities: + +```bash +$ make SKIP_UTILS='UTILITY_1 UTILITY_2' install +``` + +To install only a few of the available utilities: + +```bash +$ make UTILS='UTILITY_1 UTILITY_2' install +``` + +To install every program with a prefix (e.g. uu-echo uu-cat): + +```bash +$ make PROG_PREFIX=PREFIX_GOES_HERE install +``` + +To install the multicall binary: + +```bash +$ make MULTICALL=y install +``` + +Set install parent directory (default value is /usr/local): + +```bash +# DESTDIR is also supported +$ make PREFIX=/my/path install +``` + +Installing with `make` installs shell completions for all installed utilities +for `bash`, `fish` and `zsh`. Completions for `elvish` and `powershell` can also +be generated; See `Manually install shell completions`. + +### NixOS + +The [standard package set](https://nixos.org/nixpkgs/manual/) of [NixOS](https://nixos.org/) +provides this package out of the box since 18.03: + +```shell +$ nix-env -iA nixos.uutils-coreutils +``` + +### Manually install shell completions + +The `coreutils` binary can generate completions for the `bash`, `elvish`, `fish`, `powershell` +and `zsh` shells. It prints the result to stdout. + +The syntax is: +```bash +cargo run completion +``` + +So, to install completions for `ls` on `bash` to `/usr/local/share/bash-completion/completions/ls`, +run: + +```bash +cargo run completion ls bash > /usr/local/share/bash-completion/completions/ls +``` + +## Un-installation Instructions + +Un-installation differs depending on how you have installed uutils. If you used +Cargo to install, use Cargo to uninstall. If you used GNU Make to install, use +Make to uninstall. + +### Cargo + +To uninstall uutils: + +```bash +$ cargo uninstall uutils +``` + +### GNU Make + +To uninstall all utilities: + +```bash +$ make uninstall +``` + +To uninstall every program with a set prefix: + +```bash +$ make PROG_PREFIX=PREFIX_GOES_HERE uninstall +``` + +To uninstall the multicall binary: + +```bash +$ make MULTICALL=y uninstall +``` + +To uninstall from a custom parent directory: + +```bash +# DESTDIR is also supported +$ make PREFIX=/my/path uninstall +``` diff --git a/docs/src/introduction.md b/docs/src/introduction.md deleted file mode 100644 index 261205d34..000000000 --- a/docs/src/introduction.md +++ /dev/null @@ -1,8 +0,0 @@ -# Introduction - -uutils is an attempt at writing universal (as in cross-platform) CLI -utilities in [Rust](https://www.rust-lang.org). The source code is hosted -on [GitHub](https://github.com/uutils/coreutils). - -> Note: This manual is automatically generated from the source code and is -> a work in progress. \ No newline at end of file diff --git a/docs/theme/favicon.png b/docs/theme/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..1cd1f26ecabfc39e81c1e8ccc1a1aeca73aa224e GIT binary patch literal 13227 zcmeAS@N?(olHy`uVBq!ia0y~yU^oH79Bd2>3~M9S&0}C-;4JWnEM{QfI|9OtQ?>b| z85k58JY5_^DsH{4Esqfi|Nd|D)HqfbftQOqOpl2EiVn z;l3t;2R|K?GSIljvUnqFG>?D_%f<#JB_)m2)W+Cpy2bVND!(RkyxC;ES;y%7@t-e_ z&#g{>cCPZ-yyAB|pBHc_vgkx?SRou!#u2e0f%8xktG9rdPDIm&go8pYtlZNSbRsse zBrcTXPz=zTny~ksj$_0hZl#GF+1J(_ys*$&P)w|?onL-abCSY?4cx7}7H`=i5*iv> zP*l_uppg?2y)&lIviMoT{e89i>HT$oe<|A8$(5Cr^}gy}q#+_E)^z&mp^FyyDejhDH0?V5_Rvh(6P6(P=D>vC0j8aYrC`~^t{l;Bu>ZHog&jjWAzeiQq*Viu! z(YiVPsF2Hl4Lv=zx3{;i58hxY!}s&UVg61Jl~vnoy}Y5v_co(lC`hf6L+vi@y`63Pn;{) zty>qYDrJ@v(fp*Mu%fbZVpCI-)%%CH^Y^PVH7>ZfO@^=C#l^*>%H~LtVW5VHj&+ok zqmi-k$=~ny`{(55dfwkxd-DDM|LZ1tEeg;$v7_+u6)yAk!-~bv&#hgm7AWFc_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git a/docs/theme/head.hbs b/docs/theme/head.hbs index 2d481cdac..7ce6ac83c 100644 --- a/docs/theme/head.hbs +++ b/docs/theme/head.hbs @@ -2,4 +2,12 @@ dd { margin-bottom: 1em; } + main { + position: relative; + } + .version { + position: absolute; + top: 1em; + right: 0; + } \ No newline at end of file diff --git a/src/bin/uudoc.rs b/src/bin/uudoc.rs index ce51e8833..6155fa8b2 100644 --- a/src/bin/uudoc.rs +++ b/src/bin/uudoc.rs @@ -14,8 +14,6 @@ use std::io::Write; include!(concat!(env!("OUT_DIR"), "/uutils_map.rs")); fn main() { - uucore::panic::mute_sigpipe_panic(); - let utils = util_map::>>(); for (name, (_, app)) in utils { @@ -23,18 +21,28 @@ fn main() { if let Ok(f) = File::create(&p) { write_markdown(f, &mut app()); println!("Wrote to '{}'", p); + } else { + println!("Error writing to {}", p); } } } fn write_markdown(mut w: impl Write, app: &mut App) { + write_version(&mut w, app); write_summary(&mut w, app); write_options(&mut w, app); } +fn write_version(w: &mut impl Write, app: &App) { + let _ = writeln!( + w, + "
version: {}
", + app.render_version().split_once(' ').unwrap().1 + ); +} + fn write_summary(w: &mut impl Write, app: &App) { if let Some(about) = app.get_long_about().or_else(|| app.get_about()) { - let _ = writeln!(w, "

Summary

"); let _ = writeln!(w, "{}", about); } } From 83d5d1558e311f2c959aa4dfdfa37281eee07f1d Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Thu, 20 Jan 2022 23:21:02 +0100 Subject: [PATCH 06/15] docs: add multi-call binary --- docs/src/SUMMARY.md | 3 +++ docs/src/index.md | 2 +- docs/src/multicall.md | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 docs/src/multicall.md diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 1364134b1..ecde924be 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -3,6 +3,9 @@ [Introduction](index.md) * [Installation](installation.md) * [Contributing](contributing.md) + +# Reference +* [Multi-call binary](multicall.md) * [Utils](utils/index.md) * [arch](utils/arch.md) * [base32](utils/base32.md) diff --git a/docs/src/index.md b/docs/src/index.md index 23cc0d9af..52490f41d 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -6,7 +6,7 @@ Linux, Windows, Mac and other platforms. The API reference for `uucore`, the library of functions shared between various utils, is hosted at at -[docs.rs](https://docs.rs/uucore/0.0.10/uucore/). +[docs.rs](https://docs.rs/uucore/0.0.12/uucore/). uutils is licensed under the [MIT License](https://github.com/uutils/coreutils/LICENSE.md). diff --git a/docs/src/multicall.md b/docs/src/multicall.md new file mode 100644 index 000000000..5d7b8b169 --- /dev/null +++ b/docs/src/multicall.md @@ -0,0 +1,17 @@ +# Multi-call binary +uutils includes a multi-call binary from which the utils can be invoked. This +reduces the binary size of the binary and can be useful for portability. + +The first argument of the multi-call binary is the util to run, after which +the regular arguments to the util can be passed. + +```shell +coreutils [util] [util options] +``` + +The `--help` flag will print a list of available utils. + +## Example +``` +coreutils ls -l +``` \ No newline at end of file From bd4d26d37ce082522fbb658a929395827e31d425 Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Thu, 20 Jan 2022 23:21:48 +0100 Subject: [PATCH 07/15] docs: remove old manpage generation --- GNUmakefile | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 12cd95013..b43c3596b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -279,10 +279,7 @@ endif build-coreutils: ${CARGO} build ${CARGOFLAGS} --features "${EXES}" ${PROFILE_CMD} --no-default-features -build-manpages: - cd $(DOCSDIR) && $(MAKE) man - -build: build-coreutils build-pkgs build-manpages +build: build-coreutils build-pkgs $(foreach test,$(filter-out $(SKIP_UTILS),$(PROGS)),$(eval $(call TEST_BUSYBOX,$(test)))) @@ -330,14 +327,11 @@ ifeq (${MULTICALL}, y) cd $(INSTALLDIR_BIN) && $(foreach prog, $(filter-out coreutils, $(INSTALLEES)), \ ln -fs $(PROG_PREFIX)coreutils $(PROG_PREFIX)$(prog) &&) : $(if $(findstring test,$(INSTALLEES)), cd $(INSTALLDIR_BIN) && ln -fs $(PROG_PREFIX)coreutils $(PROG_PREFIX)[) - cat $(DOCSDIR)/_build/man/coreutils.1 | gzip > $(INSTALLDIR_MAN)/$(PROG_PREFIX)coreutils.1.gz else $(foreach prog, $(INSTALLEES), \ $(INSTALL) $(BUILDDIR)/$(prog) $(INSTALLDIR_BIN)/$(PROG_PREFIX)$(prog);) $(if $(findstring test,$(INSTALLEES)), $(INSTALL) $(BUILDDIR)/test $(INSTALLDIR_BIN)/$(PROG_PREFIX)[) endif - $(foreach man, $(filter $(INSTALLEES), $(basename $(notdir $(wildcard $(DOCSDIR)/_build/man/*)))), \ - cat $(DOCSDIR)/_build/man/$(man).1 | gzip > $(INSTALLDIR_MAN)/$(PROG_PREFIX)$(man).1.gz &&) : mkdir -p $(DESTDIR)$(PREFIX)/share/zsh/site-functions mkdir -p $(DESTDIR)$(PREFIX)/share/bash-completion/completions mkdir -p $(DESTDIR)$(PREFIX)/share/fish/vendor_completions.d @@ -359,4 +353,4 @@ endif rm -f $(addprefix $(DESTDIR)$(PREFIX)/share/fish/vendor_completions.d/$(PROG_PREFIX),$(addsuffix .fish,$(PROGS))) rm -f $(addprefix $(INSTALLDIR_MAN)/$(PROG_PREFIX),$(addsuffix .1.gz,$(PROGS))) -.PHONY: all build build-coreutils build-pkgs build-docs test distclean clean busytest install uninstall +.PHONY: all build build-coreutils build-pkgs test distclean clean busytest install uninstall From 274459f2ede398cd727b3043ca2fdf3bbc48da10 Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Fri, 21 Jan 2022 18:28:51 +0100 Subject: [PATCH 08/15] docs: spelling fixes --- .vscode/cspell.dictionaries/workspace.wordlist.txt | 1 + docs/src/installation.md | 1 + 2 files changed, 2 insertions(+) diff --git a/.vscode/cspell.dictionaries/workspace.wordlist.txt b/.vscode/cspell.dictionaries/workspace.wordlist.txt index b68da6eb7..485009186 100644 --- a/.vscode/cspell.dictionaries/workspace.wordlist.txt +++ b/.vscode/cspell.dictionaries/workspace.wordlist.txt @@ -312,6 +312,7 @@ optopt ccmd coreopts coreutils +uudoc keepenv libc libstdbuf diff --git a/docs/src/installation.md b/docs/src/installation.md index 5b604c9da..7cf8a7f2b 100644 --- a/docs/src/installation.md +++ b/docs/src/installation.md @@ -1,3 +1,4 @@ + # Installation ## Requirements From ab3623f65a9ada6c60f47e9061d793bcf1857e6f Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Fri, 21 Jan 2022 19:20:55 +0100 Subject: [PATCH 09/15] docs: usage and values for options --- src/bin/uudoc.rs | 46 ++++++++++++++++++++++++++++----- src/uu/sum/src/sum.rs | 6 ++--- src/uu/unexpand/src/unexpand.rs | 4 +-- 3 files changed, 45 insertions(+), 11 deletions(-) diff --git a/src/bin/uudoc.rs b/src/bin/uudoc.rs index 6155fa8b2..1b0376189 100644 --- a/src/bin/uudoc.rs +++ b/src/bin/uudoc.rs @@ -19,7 +19,7 @@ fn main() { for (name, (_, app)) in utils { let p = format!("docs/_generated/{}-help.md", name); if let Ok(f) = File::create(&p) { - write_markdown(f, &mut app()); + write_markdown(f, &mut app(), name); println!("Wrote to '{}'", p); } else { println!("Error writing to {}", p); @@ -27,8 +27,9 @@ fn main() { } } -fn write_markdown(mut w: impl Write, app: &mut App) { +fn write_markdown(mut w: impl Write, app: &mut App, name: &str) { write_version(&mut w, app); + write_usage(&mut w, app, name); write_summary(&mut w, app); write_options(&mut w, app); } @@ -41,6 +42,14 @@ fn write_version(w: &mut impl Write, app: &App) { ); } +fn write_usage(w: &mut impl Write, app: &mut App, name: &str) { + let _ = writeln!(w, "\n```"); + let mut usage: String = app.render_usage().lines().nth(1).unwrap().trim().into(); + usage = usage.replace(app.get_name(), name); + let _ = writeln!(w, "{}", usage); + let _ = writeln!(w, "```"); +} + fn write_summary(w: &mut impl Write, app: &App) { if let Some(about) = app.get_long_about().or_else(|| app.get_about()) { let _ = writeln!(w, "{}", about); @@ -59,18 +68,43 @@ fn write_options(w: &mut impl Write, app: &App) { } else { first = false; } - let _ = write!(w, "--{}", l); + let _ = write!(w, ""); + let _ = write!(w, "--{}", l); + if let Some(names) = arg.get_value_names() { + let _ = write!( + w, + "={}", + names + .iter() + .map(|x| format!("<{}>", x)) + .collect::>() + .join(" ") + ); + } + let _ = write!(w, ""); } - for l in arg.get_short_and_visible_aliases().unwrap_or_default() { + for s in arg.get_short_and_visible_aliases().unwrap_or_default() { if !first { let _ = write!(w, ", "); } else { first = false; } - let _ = write!(w, "-{}", l); + let _ = write!(w, ""); + let _ = write!(w, "-{}", s); + if let Some(names) = arg.get_value_names() { + let _ = write!( + w, + " {}", + names + .iter() + .map(|x| format!("<{}>", x)) + .collect::>() + .join(" ") + ); + } + let _ = write!(w, ""); } let _ = writeln!(w, ""); - let _ = writeln!(w, "
{}
", arg.get_help().unwrap_or_default()); } let _ = writeln!(w, ""); diff --git a/src/uu/sum/src/sum.rs b/src/uu/sum/src/sum.rs index 67bff31b0..1c2b19ba5 100644 --- a/src/uu/sum/src/sum.rs +++ b/src/uu/sum/src/sum.rs @@ -19,9 +19,9 @@ use uucore::error::{FromIo, UResult, USimpleError}; use uucore::InvalidEncodingHandling; static NAME: &str = "sum"; -static USAGE: &str = - "[OPTION]... [FILE]...\nWith no FILE, or when FILE is -, read standard input."; -static SUMMARY: &str = "Checksum and count the blocks in a file."; +static USAGE: &str = "sum [OPTION]... [FILE]..."; +static SUMMARY: &str = "Checksum and count the blocks in a file.\n\ + With no FILE, or when FILE is -, read standard input."; fn bsd_sum(mut reader: Box) -> (usize, u16) { let mut buf = [0; 1024]; diff --git a/src/uu/unexpand/src/unexpand.rs b/src/uu/unexpand/src/unexpand.rs index 83220a012..812375117 100644 --- a/src/uu/unexpand/src/unexpand.rs +++ b/src/uu/unexpand/src/unexpand.rs @@ -22,8 +22,8 @@ use uucore::InvalidEncodingHandling; static NAME: &str = "unexpand"; static USAGE: &str = "unexpand [OPTION]... [FILE]..."; -static SUMMARY: &str = "Convert blanks in each FILE to tabs, writing to standard output.\n - With no FILE, or when FILE is -, read standard input."; +static SUMMARY: &str = "Convert blanks in each FILE to tabs, writing to standard output.\n\ + With no FILE, or when FILE is -, read standard input."; const DEFAULT_TABSTOP: usize = 8; From e3558ff3a81cdb37cace6254971f505af0c662fa Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Fri, 21 Jan 2022 19:43:40 +0100 Subject: [PATCH 10/15] docs: additional spelling fixes --- .vscode/cspell.dictionaries/workspace.wordlist.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/cspell.dictionaries/workspace.wordlist.txt b/.vscode/cspell.dictionaries/workspace.wordlist.txt index 485009186..e41aba979 100644 --- a/.vscode/cspell.dictionaries/workspace.wordlist.txt +++ b/.vscode/cspell.dictionaries/workspace.wordlist.txt @@ -25,6 +25,7 @@ getrandom globset itertools lscolors +mdbook memchr multifilereader onig @@ -312,7 +313,6 @@ optopt ccmd coreopts coreutils -uudoc keepenv libc libstdbuf @@ -323,6 +323,7 @@ ucommand utmpx uucore uucore_procs +uudoc uumain uutil uutils From 9618a2f21d43e55a787404c72ddb2bdcd178f17a Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Fri, 21 Jan 2022 20:17:51 +0100 Subject: [PATCH 11/15] docs: remove custom files --- docs/.gitignore | 2 +- docs/create_docs.py | 20 ++-- docs/src/SUMMARY.md | 201 ++++++++++++++++++------------------ docs/src/utils/arch.md | 3 - docs/src/utils/base32.md | 3 - docs/src/utils/base64.md | 3 - docs/src/utils/basename.md | 3 - docs/src/utils/basenc.md | 3 - docs/src/utils/cat.md | 3 - docs/src/utils/chcon.md | 3 - docs/src/utils/chgrp.md | 3 - docs/src/utils/chmod.md | 3 - docs/src/utils/chown.md | 3 - docs/src/utils/chroot.md | 3 - docs/src/utils/cksum.md | 3 - docs/src/utils/comm.md | 3 - docs/src/utils/cp.md | 3 - docs/src/utils/csplit.md | 3 - docs/src/utils/cut.md | 3 - docs/src/utils/date.md | 3 - docs/src/utils/dd.md | 3 - docs/src/utils/df.md | 3 - docs/src/utils/dircolors.md | 3 - docs/src/utils/dirname.md | 3 - docs/src/utils/du.md | 3 - docs/src/utils/echo.md | 3 - docs/src/utils/env.md | 3 - docs/src/utils/expand.md | 3 - docs/src/utils/expr.md | 3 - docs/src/utils/factor.md | 3 - docs/src/utils/false.md | 3 - docs/src/utils/fmt.md | 3 - docs/src/utils/fold.md | 3 - docs/src/utils/groups.md | 3 - docs/src/utils/hashsum.md | 3 - docs/src/utils/head.md | 3 - docs/src/utils/hostid.md | 3 - docs/src/utils/hostname.md | 3 - docs/src/utils/id.md | 3 - docs/src/utils/index.md | 102 ------------------ docs/src/utils/install.md | 3 - docs/src/utils/join.md | 3 - docs/src/utils/kill.md | 3 - docs/src/utils/link.md | 3 - docs/src/utils/ln.md | 3 - docs/src/utils/logname.md | 3 - docs/src/utils/ls.md | 3 - docs/src/utils/mkdir.md | 3 - docs/src/utils/mkfifo.md | 3 - docs/src/utils/mknod.md | 3 - docs/src/utils/mktemp.md | 3 - docs/src/utils/more.md | 3 - docs/src/utils/mv.md | 3 - docs/src/utils/nice.md | 3 - docs/src/utils/nl.md | 3 - docs/src/utils/nohup.md | 3 - docs/src/utils/nproc.md | 3 - docs/src/utils/numfmt.md | 3 - docs/src/utils/od.md | 3 - docs/src/utils/paste.md | 3 - docs/src/utils/pathchk.md | 3 - docs/src/utils/pinky.md | 3 - docs/src/utils/pr.md | 3 - docs/src/utils/printenv.md | 3 - docs/src/utils/printf.md | 3 - docs/src/utils/ptx.md | 3 - docs/src/utils/pwd.md | 3 - docs/src/utils/readlink.md | 3 - docs/src/utils/realpath.md | 3 - docs/src/utils/relpath.md | 3 - docs/src/utils/rm.md | 3 - docs/src/utils/rmdir.md | 3 - docs/src/utils/runcon.md | 3 - docs/src/utils/seq.md | 3 - docs/src/utils/shred.md | 3 - docs/src/utils/shuf.md | 3 - docs/src/utils/sleep.md | 3 - docs/src/utils/sort.md | 3 - docs/src/utils/split.md | 3 - docs/src/utils/stat.md | 3 - docs/src/utils/stdbuf.md | 3 - docs/src/utils/sum.md | 3 - docs/src/utils/sync.md | 3 - docs/src/utils/tac.md | 3 - docs/src/utils/tail.md | 3 - docs/src/utils/tee.md | 3 - docs/src/utils/test.md | 3 - docs/src/utils/timeout.md | 3 - docs/src/utils/touch.md | 3 - docs/src/utils/tr.md | 3 - docs/src/utils/true.md | 3 - docs/src/utils/truncate.md | 3 - docs/src/utils/tsort.md | 3 - docs/src/utils/tty.md | 3 - docs/src/utils/uname.md | 3 - docs/src/utils/unexpand.md | 3 - docs/src/utils/uniq.md | 3 - docs/src/utils/unlink.md | 3 - docs/src/utils/uptime.md | 3 - docs/src/utils/users.md | 3 - docs/src/utils/wc.md | 3 - docs/src/utils/who.md | 3 - docs/src/utils/whoami.md | 3 - docs/src/utils/yes.md | 3 - src/bin/uudoc.rs | 11 +- 105 files changed, 115 insertions(+), 521 deletions(-) delete mode 100644 docs/src/utils/arch.md delete mode 100644 docs/src/utils/base32.md delete mode 100644 docs/src/utils/base64.md delete mode 100644 docs/src/utils/basename.md delete mode 100644 docs/src/utils/basenc.md delete mode 100644 docs/src/utils/cat.md delete mode 100644 docs/src/utils/chcon.md delete mode 100644 docs/src/utils/chgrp.md delete mode 100644 docs/src/utils/chmod.md delete mode 100644 docs/src/utils/chown.md delete mode 100644 docs/src/utils/chroot.md delete mode 100644 docs/src/utils/cksum.md delete mode 100644 docs/src/utils/comm.md delete mode 100644 docs/src/utils/cp.md delete mode 100644 docs/src/utils/csplit.md delete mode 100644 docs/src/utils/cut.md delete mode 100644 docs/src/utils/date.md delete mode 100644 docs/src/utils/dd.md delete mode 100644 docs/src/utils/df.md delete mode 100644 docs/src/utils/dircolors.md delete mode 100644 docs/src/utils/dirname.md delete mode 100644 docs/src/utils/du.md delete mode 100644 docs/src/utils/echo.md delete mode 100644 docs/src/utils/env.md delete mode 100644 docs/src/utils/expand.md delete mode 100644 docs/src/utils/expr.md delete mode 100644 docs/src/utils/factor.md delete mode 100644 docs/src/utils/false.md delete mode 100644 docs/src/utils/fmt.md delete mode 100644 docs/src/utils/fold.md delete mode 100644 docs/src/utils/groups.md delete mode 100644 docs/src/utils/hashsum.md delete mode 100644 docs/src/utils/head.md delete mode 100644 docs/src/utils/hostid.md delete mode 100644 docs/src/utils/hostname.md delete mode 100644 docs/src/utils/id.md delete mode 100644 docs/src/utils/index.md delete mode 100644 docs/src/utils/install.md delete mode 100644 docs/src/utils/join.md delete mode 100644 docs/src/utils/kill.md delete mode 100644 docs/src/utils/link.md delete mode 100644 docs/src/utils/ln.md delete mode 100644 docs/src/utils/logname.md delete mode 100644 docs/src/utils/ls.md delete mode 100644 docs/src/utils/mkdir.md delete mode 100644 docs/src/utils/mkfifo.md delete mode 100644 docs/src/utils/mknod.md delete mode 100644 docs/src/utils/mktemp.md delete mode 100644 docs/src/utils/more.md delete mode 100644 docs/src/utils/mv.md delete mode 100644 docs/src/utils/nice.md delete mode 100644 docs/src/utils/nl.md delete mode 100644 docs/src/utils/nohup.md delete mode 100644 docs/src/utils/nproc.md delete mode 100644 docs/src/utils/numfmt.md delete mode 100644 docs/src/utils/od.md delete mode 100644 docs/src/utils/paste.md delete mode 100644 docs/src/utils/pathchk.md delete mode 100644 docs/src/utils/pinky.md delete mode 100644 docs/src/utils/pr.md delete mode 100644 docs/src/utils/printenv.md delete mode 100644 docs/src/utils/printf.md delete mode 100644 docs/src/utils/ptx.md delete mode 100644 docs/src/utils/pwd.md delete mode 100644 docs/src/utils/readlink.md delete mode 100644 docs/src/utils/realpath.md delete mode 100644 docs/src/utils/relpath.md delete mode 100644 docs/src/utils/rm.md delete mode 100644 docs/src/utils/rmdir.md delete mode 100644 docs/src/utils/runcon.md delete mode 100644 docs/src/utils/seq.md delete mode 100644 docs/src/utils/shred.md delete mode 100644 docs/src/utils/shuf.md delete mode 100644 docs/src/utils/sleep.md delete mode 100644 docs/src/utils/sort.md delete mode 100644 docs/src/utils/split.md delete mode 100644 docs/src/utils/stat.md delete mode 100644 docs/src/utils/stdbuf.md delete mode 100644 docs/src/utils/sum.md delete mode 100644 docs/src/utils/sync.md delete mode 100644 docs/src/utils/tac.md delete mode 100644 docs/src/utils/tail.md delete mode 100644 docs/src/utils/tee.md delete mode 100644 docs/src/utils/test.md delete mode 100644 docs/src/utils/timeout.md delete mode 100644 docs/src/utils/touch.md delete mode 100644 docs/src/utils/tr.md delete mode 100644 docs/src/utils/true.md delete mode 100644 docs/src/utils/truncate.md delete mode 100644 docs/src/utils/tsort.md delete mode 100644 docs/src/utils/tty.md delete mode 100644 docs/src/utils/uname.md delete mode 100644 docs/src/utils/unexpand.md delete mode 100644 docs/src/utils/uniq.md delete mode 100644 docs/src/utils/unlink.md delete mode 100644 docs/src/utils/uptime.md delete mode 100644 docs/src/utils/users.md delete mode 100644 docs/src/utils/wc.md delete mode 100644 docs/src/utils/who.md delete mode 100644 docs/src/utils/whoami.md delete mode 100644 docs/src/utils/yes.md diff --git a/docs/.gitignore b/docs/.gitignore index 0b2699ecb..f06cae769 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1,2 +1,2 @@ book -_generated \ No newline at end of file +src/utils diff --git a/docs/create_docs.py b/docs/create_docs.py index 6fd9314a4..2fde09e55 100644 --- a/docs/create_docs.py +++ b/docs/create_docs.py @@ -4,17 +4,9 @@ import os -with open('src/utils/index.md', 'w') as index: - with open('src/SUMMARY.md', 'w') as summary: - summary.write("# Summary\n\n") - summary.write("[Introduction](index.md)\n") - summary.write("* [Contributing](contributing.md)\n") - summary.write("* [Utils](utils/index.md)\n") - index.write("# Utils\n\n") - for d in sorted(os.listdir('../src/uu')): - with open(f"src/utils/{d}.md", 'w') as f: - f.write(f"# {d}\n\n") - f.write(f"{{{{ #include ../../_generated/{d}-help.md }}}}\n") - print(f"Created docs/src/utils/{d}.md") - summary.write(f" * [{d}](utils/{d}.md)\n") - index.write(f"* [{d}](./{d}.md)\n") \ No newline at end of file +with open('src/SUMMARY.md', 'w') as summary: + summary.write("# Summary\n\n") + summary.write("[Introduction](index.md)\n") + summary.write("* [Contributing](contributing.md)\n") + for d in sorted(os.listdir('../src/uu')): + summary.write(f"* [{d}](utils/{d}.md)\n") \ No newline at end of file diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index ecde924be..02001b08c 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -6,104 +6,103 @@ # Reference * [Multi-call binary](multicall.md) -* [Utils](utils/index.md) - * [arch](utils/arch.md) - * [base32](utils/base32.md) - * [base64](utils/base64.md) - * [basename](utils/basename.md) - * [basenc](utils/basenc.md) - * [cat](utils/cat.md) - * [chcon](utils/chcon.md) - * [chgrp](utils/chgrp.md) - * [chmod](utils/chmod.md) - * [chown](utils/chown.md) - * [chroot](utils/chroot.md) - * [cksum](utils/cksum.md) - * [comm](utils/comm.md) - * [cp](utils/cp.md) - * [csplit](utils/csplit.md) - * [cut](utils/cut.md) - * [date](utils/date.md) - * [dd](utils/dd.md) - * [df](utils/df.md) - * [dircolors](utils/dircolors.md) - * [dirname](utils/dirname.md) - * [du](utils/du.md) - * [echo](utils/echo.md) - * [env](utils/env.md) - * [expand](utils/expand.md) - * [expr](utils/expr.md) - * [factor](utils/factor.md) - * [false](utils/false.md) - * [fmt](utils/fmt.md) - * [fold](utils/fold.md) - * [groups](utils/groups.md) - * [hashsum](utils/hashsum.md) - * [head](utils/head.md) - * [hostid](utils/hostid.md) - * [hostname](utils/hostname.md) - * [id](utils/id.md) - * [install](utils/install.md) - * [join](utils/join.md) - * [kill](utils/kill.md) - * [link](utils/link.md) - * [ln](utils/ln.md) - * [logname](utils/logname.md) - * [ls](utils/ls.md) - * [mkdir](utils/mkdir.md) - * [mkfifo](utils/mkfifo.md) - * [mknod](utils/mknod.md) - * [mktemp](utils/mktemp.md) - * [more](utils/more.md) - * [mv](utils/mv.md) - * [nice](utils/nice.md) - * [nl](utils/nl.md) - * [nohup](utils/nohup.md) - * [nproc](utils/nproc.md) - * [numfmt](utils/numfmt.md) - * [od](utils/od.md) - * [paste](utils/paste.md) - * [pathchk](utils/pathchk.md) - * [pinky](utils/pinky.md) - * [pr](utils/pr.md) - * [printenv](utils/printenv.md) - * [printf](utils/printf.md) - * [ptx](utils/ptx.md) - * [pwd](utils/pwd.md) - * [readlink](utils/readlink.md) - * [realpath](utils/realpath.md) - * [relpath](utils/relpath.md) - * [rm](utils/rm.md) - * [rmdir](utils/rmdir.md) - * [runcon](utils/runcon.md) - * [seq](utils/seq.md) - * [shred](utils/shred.md) - * [shuf](utils/shuf.md) - * [sleep](utils/sleep.md) - * [sort](utils/sort.md) - * [split](utils/split.md) - * [stat](utils/stat.md) - * [stdbuf](utils/stdbuf.md) - * [sum](utils/sum.md) - * [sync](utils/sync.md) - * [tac](utils/tac.md) - * [tail](utils/tail.md) - * [tee](utils/tee.md) - * [test](utils/test.md) - * [timeout](utils/timeout.md) - * [touch](utils/touch.md) - * [tr](utils/tr.md) - * [true](utils/true.md) - * [truncate](utils/truncate.md) - * [tsort](utils/tsort.md) - * [tty](utils/tty.md) - * [uname](utils/uname.md) - * [unexpand](utils/unexpand.md) - * [uniq](utils/uniq.md) - * [unlink](utils/unlink.md) - * [uptime](utils/uptime.md) - * [users](utils/users.md) - * [wc](utils/wc.md) - * [who](utils/who.md) - * [whoami](utils/whoami.md) - * [yes](utils/yes.md) +* [arch](utils/arch.md) +* [base32](utils/base32.md) +* [base64](utils/base64.md) +* [basename](utils/basename.md) +* [basenc](utils/basenc.md) +* [cat](utils/cat.md) +* [chcon](utils/chcon.md) +* [chgrp](utils/chgrp.md) +* [chmod](utils/chmod.md) +* [chown](utils/chown.md) +* [chroot](utils/chroot.md) +* [cksum](utils/cksum.md) +* [comm](utils/comm.md) +* [cp](utils/cp.md) +* [csplit](utils/csplit.md) +* [cut](utils/cut.md) +* [date](utils/date.md) +* [dd](utils/dd.md) +* [df](utils/df.md) +* [dircolors](utils/dircolors.md) +* [dirname](utils/dirname.md) +* [du](utils/du.md) +* [echo](utils/echo.md) +* [env](utils/env.md) +* [expand](utils/expand.md) +* [expr](utils/expr.md) +* [factor](utils/factor.md) +* [false](utils/false.md) +* [fmt](utils/fmt.md) +* [fold](utils/fold.md) +* [groups](utils/groups.md) +* [hashsum](utils/hashsum.md) +* [head](utils/head.md) +* [hostid](utils/hostid.md) +* [hostname](utils/hostname.md) +* [id](utils/id.md) +* [install](utils/install.md) +* [join](utils/join.md) +* [kill](utils/kill.md) +* [link](utils/link.md) +* [ln](utils/ln.md) +* [logname](utils/logname.md) +* [ls](utils/ls.md) +* [mkdir](utils/mkdir.md) +* [mkfifo](utils/mkfifo.md) +* [mknod](utils/mknod.md) +* [mktemp](utils/mktemp.md) +* [more](utils/more.md) +* [mv](utils/mv.md) +* [nice](utils/nice.md) +* [nl](utils/nl.md) +* [nohup](utils/nohup.md) +* [nproc](utils/nproc.md) +* [numfmt](utils/numfmt.md) +* [od](utils/od.md) +* [paste](utils/paste.md) +* [pathchk](utils/pathchk.md) +* [pinky](utils/pinky.md) +* [pr](utils/pr.md) +* [printenv](utils/printenv.md) +* [printf](utils/printf.md) +* [ptx](utils/ptx.md) +* [pwd](utils/pwd.md) +* [readlink](utils/readlink.md) +* [realpath](utils/realpath.md) +* [relpath](utils/relpath.md) +* [rm](utils/rm.md) +* [rmdir](utils/rmdir.md) +* [runcon](utils/runcon.md) +* [seq](utils/seq.md) +* [shred](utils/shred.md) +* [shuf](utils/shuf.md) +* [sleep](utils/sleep.md) +* [sort](utils/sort.md) +* [split](utils/split.md) +* [stat](utils/stat.md) +* [stdbuf](utils/stdbuf.md) +* [sum](utils/sum.md) +* [sync](utils/sync.md) +* [tac](utils/tac.md) +* [tail](utils/tail.md) +* [tee](utils/tee.md) +* [test](utils/test.md) +* [timeout](utils/timeout.md) +* [touch](utils/touch.md) +* [tr](utils/tr.md) +* [true](utils/true.md) +* [truncate](utils/truncate.md) +* [tsort](utils/tsort.md) +* [tty](utils/tty.md) +* [uname](utils/uname.md) +* [unexpand](utils/unexpand.md) +* [uniq](utils/uniq.md) +* [unlink](utils/unlink.md) +* [uptime](utils/uptime.md) +* [users](utils/users.md) +* [wc](utils/wc.md) +* [who](utils/who.md) +* [whoami](utils/whoami.md) +* [yes](utils/yes.md) diff --git a/docs/src/utils/arch.md b/docs/src/utils/arch.md deleted file mode 100644 index b0ca5c7e9..000000000 --- a/docs/src/utils/arch.md +++ /dev/null @@ -1,3 +0,0 @@ -# arch - -{{ #include ../../_generated/arch-help.md }} diff --git a/docs/src/utils/base32.md b/docs/src/utils/base32.md deleted file mode 100644 index d79092b3d..000000000 --- a/docs/src/utils/base32.md +++ /dev/null @@ -1,3 +0,0 @@ -# base32 - -{{ #include ../../_generated/base32-help.md }} diff --git a/docs/src/utils/base64.md b/docs/src/utils/base64.md deleted file mode 100644 index 6864531f8..000000000 --- a/docs/src/utils/base64.md +++ /dev/null @@ -1,3 +0,0 @@ -# base64 - -{{ #include ../../_generated/base64-help.md }} diff --git a/docs/src/utils/basename.md b/docs/src/utils/basename.md deleted file mode 100644 index 9a20edfd2..000000000 --- a/docs/src/utils/basename.md +++ /dev/null @@ -1,3 +0,0 @@ -# basename - -{{ #include ../../_generated/basename-help.md }} diff --git a/docs/src/utils/basenc.md b/docs/src/utils/basenc.md deleted file mode 100644 index bc6721be8..000000000 --- a/docs/src/utils/basenc.md +++ /dev/null @@ -1,3 +0,0 @@ -# basenc - -{{ #include ../../_generated/basenc-help.md }} diff --git a/docs/src/utils/cat.md b/docs/src/utils/cat.md deleted file mode 100644 index e8a3f02e0..000000000 --- a/docs/src/utils/cat.md +++ /dev/null @@ -1,3 +0,0 @@ -# cat - -{{ #include ../../_generated/cat-help.md }} diff --git a/docs/src/utils/chcon.md b/docs/src/utils/chcon.md deleted file mode 100644 index eb416b8d2..000000000 --- a/docs/src/utils/chcon.md +++ /dev/null @@ -1,3 +0,0 @@ -# chcon - -{{ #include ../../_generated/chcon-help.md }} diff --git a/docs/src/utils/chgrp.md b/docs/src/utils/chgrp.md deleted file mode 100644 index 5b40501a7..000000000 --- a/docs/src/utils/chgrp.md +++ /dev/null @@ -1,3 +0,0 @@ -# chgrp - -{{ #include ../../_generated/chgrp-help.md }} diff --git a/docs/src/utils/chmod.md b/docs/src/utils/chmod.md deleted file mode 100644 index 91ec83f1d..000000000 --- a/docs/src/utils/chmod.md +++ /dev/null @@ -1,3 +0,0 @@ -# chmod - -{{ #include ../../_generated/chmod-help.md }} diff --git a/docs/src/utils/chown.md b/docs/src/utils/chown.md deleted file mode 100644 index 72a4a1141..000000000 --- a/docs/src/utils/chown.md +++ /dev/null @@ -1,3 +0,0 @@ -# chown - -{{ #include ../../_generated/chown-help.md }} diff --git a/docs/src/utils/chroot.md b/docs/src/utils/chroot.md deleted file mode 100644 index 603c1e948..000000000 --- a/docs/src/utils/chroot.md +++ /dev/null @@ -1,3 +0,0 @@ -# chroot - -{{ #include ../../_generated/chroot-help.md }} diff --git a/docs/src/utils/cksum.md b/docs/src/utils/cksum.md deleted file mode 100644 index 544452d53..000000000 --- a/docs/src/utils/cksum.md +++ /dev/null @@ -1,3 +0,0 @@ -# cksum - -{{ #include ../../_generated/cksum-help.md }} diff --git a/docs/src/utils/comm.md b/docs/src/utils/comm.md deleted file mode 100644 index fe3aba9b6..000000000 --- a/docs/src/utils/comm.md +++ /dev/null @@ -1,3 +0,0 @@ -# comm - -{{ #include ../../_generated/comm-help.md }} diff --git a/docs/src/utils/cp.md b/docs/src/utils/cp.md deleted file mode 100644 index 10b002ec8..000000000 --- a/docs/src/utils/cp.md +++ /dev/null @@ -1,3 +0,0 @@ -# cp - -{{ #include ../../_generated/cp-help.md }} diff --git a/docs/src/utils/csplit.md b/docs/src/utils/csplit.md deleted file mode 100644 index 897a2edfc..000000000 --- a/docs/src/utils/csplit.md +++ /dev/null @@ -1,3 +0,0 @@ -# csplit - -{{ #include ../../_generated/csplit-help.md }} diff --git a/docs/src/utils/cut.md b/docs/src/utils/cut.md deleted file mode 100644 index fea0f8f32..000000000 --- a/docs/src/utils/cut.md +++ /dev/null @@ -1,3 +0,0 @@ -# cut - -{{ #include ../../_generated/cut-help.md }} diff --git a/docs/src/utils/date.md b/docs/src/utils/date.md deleted file mode 100644 index 1c6a49131..000000000 --- a/docs/src/utils/date.md +++ /dev/null @@ -1,3 +0,0 @@ -# date - -{{ #include ../../_generated/date-help.md }} diff --git a/docs/src/utils/dd.md b/docs/src/utils/dd.md deleted file mode 100644 index d74426639..000000000 --- a/docs/src/utils/dd.md +++ /dev/null @@ -1,3 +0,0 @@ -# dd - -{{ #include ../../_generated/dd-help.md }} diff --git a/docs/src/utils/df.md b/docs/src/utils/df.md deleted file mode 100644 index f22e899ec..000000000 --- a/docs/src/utils/df.md +++ /dev/null @@ -1,3 +0,0 @@ -# df - -{{ #include ../../_generated/df-help.md }} diff --git a/docs/src/utils/dircolors.md b/docs/src/utils/dircolors.md deleted file mode 100644 index fcec2dcf8..000000000 --- a/docs/src/utils/dircolors.md +++ /dev/null @@ -1,3 +0,0 @@ -# dircolors - -{{ #include ../../_generated/dircolors-help.md }} diff --git a/docs/src/utils/dirname.md b/docs/src/utils/dirname.md deleted file mode 100644 index bc86fc999..000000000 --- a/docs/src/utils/dirname.md +++ /dev/null @@ -1,3 +0,0 @@ -# dirname - -{{ #include ../../_generated/dirname-help.md }} diff --git a/docs/src/utils/du.md b/docs/src/utils/du.md deleted file mode 100644 index 79236368c..000000000 --- a/docs/src/utils/du.md +++ /dev/null @@ -1,3 +0,0 @@ -# du - -{{ #include ../../_generated/du-help.md }} diff --git a/docs/src/utils/echo.md b/docs/src/utils/echo.md deleted file mode 100644 index fb86a0533..000000000 --- a/docs/src/utils/echo.md +++ /dev/null @@ -1,3 +0,0 @@ -# echo - -{{ #include ../../_generated/echo-help.md }} diff --git a/docs/src/utils/env.md b/docs/src/utils/env.md deleted file mode 100644 index bbe828a81..000000000 --- a/docs/src/utils/env.md +++ /dev/null @@ -1,3 +0,0 @@ -# env - -{{ #include ../../_generated/env-help.md }} diff --git a/docs/src/utils/expand.md b/docs/src/utils/expand.md deleted file mode 100644 index 56c930b06..000000000 --- a/docs/src/utils/expand.md +++ /dev/null @@ -1,3 +0,0 @@ -# expand - -{{ #include ../../_generated/expand-help.md }} diff --git a/docs/src/utils/expr.md b/docs/src/utils/expr.md deleted file mode 100644 index 67914a6f3..000000000 --- a/docs/src/utils/expr.md +++ /dev/null @@ -1,3 +0,0 @@ -# expr - -{{ #include ../../_generated/expr-help.md }} diff --git a/docs/src/utils/factor.md b/docs/src/utils/factor.md deleted file mode 100644 index a135ace83..000000000 --- a/docs/src/utils/factor.md +++ /dev/null @@ -1,3 +0,0 @@ -# factor - -{{ #include ../../_generated/factor-help.md }} diff --git a/docs/src/utils/false.md b/docs/src/utils/false.md deleted file mode 100644 index 0dcf26133..000000000 --- a/docs/src/utils/false.md +++ /dev/null @@ -1,3 +0,0 @@ -# false - -{{ #include ../../_generated/false-help.md }} diff --git a/docs/src/utils/fmt.md b/docs/src/utils/fmt.md deleted file mode 100644 index 10c987500..000000000 --- a/docs/src/utils/fmt.md +++ /dev/null @@ -1,3 +0,0 @@ -# fmt - -{{ #include ../../_generated/fmt-help.md }} diff --git a/docs/src/utils/fold.md b/docs/src/utils/fold.md deleted file mode 100644 index 8b41ed45d..000000000 --- a/docs/src/utils/fold.md +++ /dev/null @@ -1,3 +0,0 @@ -# fold - -{{ #include ../../_generated/fold-help.md }} diff --git a/docs/src/utils/groups.md b/docs/src/utils/groups.md deleted file mode 100644 index 84c1e4dea..000000000 --- a/docs/src/utils/groups.md +++ /dev/null @@ -1,3 +0,0 @@ -# groups - -{{ #include ../../_generated/groups-help.md }} diff --git a/docs/src/utils/hashsum.md b/docs/src/utils/hashsum.md deleted file mode 100644 index 76fe432db..000000000 --- a/docs/src/utils/hashsum.md +++ /dev/null @@ -1,3 +0,0 @@ -# hashsum - -{{ #include ../../_generated/hashsum-help.md }} diff --git a/docs/src/utils/head.md b/docs/src/utils/head.md deleted file mode 100644 index 5b9a6dd75..000000000 --- a/docs/src/utils/head.md +++ /dev/null @@ -1,3 +0,0 @@ -# head - -{{ #include ../../_generated/head-help.md }} diff --git a/docs/src/utils/hostid.md b/docs/src/utils/hostid.md deleted file mode 100644 index 162557ce7..000000000 --- a/docs/src/utils/hostid.md +++ /dev/null @@ -1,3 +0,0 @@ -# hostid - -{{ #include ../../_generated/hostid-help.md }} diff --git a/docs/src/utils/hostname.md b/docs/src/utils/hostname.md deleted file mode 100644 index 24865db59..000000000 --- a/docs/src/utils/hostname.md +++ /dev/null @@ -1,3 +0,0 @@ -# hostname - -{{ #include ../../_generated/hostname-help.md }} diff --git a/docs/src/utils/id.md b/docs/src/utils/id.md deleted file mode 100644 index 9b850a470..000000000 --- a/docs/src/utils/id.md +++ /dev/null @@ -1,3 +0,0 @@ -# id - -{{ #include ../../_generated/id-help.md }} diff --git a/docs/src/utils/index.md b/docs/src/utils/index.md deleted file mode 100644 index 9a0c312f1..000000000 --- a/docs/src/utils/index.md +++ /dev/null @@ -1,102 +0,0 @@ -# Utils - -* [arch](./arch.md) -* [base32](./base32.md) -* [base64](./base64.md) -* [basename](./basename.md) -* [basenc](./basenc.md) -* [cat](./cat.md) -* [chcon](./chcon.md) -* [chgrp](./chgrp.md) -* [chmod](./chmod.md) -* [chown](./chown.md) -* [chroot](./chroot.md) -* [cksum](./cksum.md) -* [comm](./comm.md) -* [cp](./cp.md) -* [csplit](./csplit.md) -* [cut](./cut.md) -* [date](./date.md) -* [dd](./dd.md) -* [df](./df.md) -* [dircolors](./dircolors.md) -* [dirname](./dirname.md) -* [du](./du.md) -* [echo](./echo.md) -* [env](./env.md) -* [expand](./expand.md) -* [expr](./expr.md) -* [factor](./factor.md) -* [false](./false.md) -* [fmt](./fmt.md) -* [fold](./fold.md) -* [groups](./groups.md) -* [hashsum](./hashsum.md) -* [head](./head.md) -* [hostid](./hostid.md) -* [hostname](./hostname.md) -* [id](./id.md) -* [install](./install.md) -* [join](./join.md) -* [kill](./kill.md) -* [link](./link.md) -* [ln](./ln.md) -* [logname](./logname.md) -* [ls](./ls.md) -* [mkdir](./mkdir.md) -* [mkfifo](./mkfifo.md) -* [mknod](./mknod.md) -* [mktemp](./mktemp.md) -* [more](./more.md) -* [mv](./mv.md) -* [nice](./nice.md) -* [nl](./nl.md) -* [nohup](./nohup.md) -* [nproc](./nproc.md) -* [numfmt](./numfmt.md) -* [od](./od.md) -* [paste](./paste.md) -* [pathchk](./pathchk.md) -* [pinky](./pinky.md) -* [pr](./pr.md) -* [printenv](./printenv.md) -* [printf](./printf.md) -* [ptx](./ptx.md) -* [pwd](./pwd.md) -* [readlink](./readlink.md) -* [realpath](./realpath.md) -* [relpath](./relpath.md) -* [rm](./rm.md) -* [rmdir](./rmdir.md) -* [runcon](./runcon.md) -* [seq](./seq.md) -* [shred](./shred.md) -* [shuf](./shuf.md) -* [sleep](./sleep.md) -* [sort](./sort.md) -* [split](./split.md) -* [stat](./stat.md) -* [stdbuf](./stdbuf.md) -* [sum](./sum.md) -* [sync](./sync.md) -* [tac](./tac.md) -* [tail](./tail.md) -* [tee](./tee.md) -* [test](./test.md) -* [timeout](./timeout.md) -* [touch](./touch.md) -* [tr](./tr.md) -* [true](./true.md) -* [truncate](./truncate.md) -* [tsort](./tsort.md) -* [tty](./tty.md) -* [uname](./uname.md) -* [unexpand](./unexpand.md) -* [uniq](./uniq.md) -* [unlink](./unlink.md) -* [uptime](./uptime.md) -* [users](./users.md) -* [wc](./wc.md) -* [who](./who.md) -* [whoami](./whoami.md) -* [yes](./yes.md) diff --git a/docs/src/utils/install.md b/docs/src/utils/install.md deleted file mode 100644 index 3c91e59f4..000000000 --- a/docs/src/utils/install.md +++ /dev/null @@ -1,3 +0,0 @@ -# install - -{{ #include ../../_generated/install-help.md }} diff --git a/docs/src/utils/join.md b/docs/src/utils/join.md deleted file mode 100644 index 1f386e271..000000000 --- a/docs/src/utils/join.md +++ /dev/null @@ -1,3 +0,0 @@ -# join - -{{ #include ../../_generated/join-help.md }} diff --git a/docs/src/utils/kill.md b/docs/src/utils/kill.md deleted file mode 100644 index 8120c21bc..000000000 --- a/docs/src/utils/kill.md +++ /dev/null @@ -1,3 +0,0 @@ -# kill - -{{ #include ../../_generated/kill-help.md }} diff --git a/docs/src/utils/link.md b/docs/src/utils/link.md deleted file mode 100644 index 8a9666eef..000000000 --- a/docs/src/utils/link.md +++ /dev/null @@ -1,3 +0,0 @@ -# link - -{{ #include ../../_generated/link-help.md }} diff --git a/docs/src/utils/ln.md b/docs/src/utils/ln.md deleted file mode 100644 index b8722a550..000000000 --- a/docs/src/utils/ln.md +++ /dev/null @@ -1,3 +0,0 @@ -# ln - -{{ #include ../../_generated/ln-help.md }} diff --git a/docs/src/utils/logname.md b/docs/src/utils/logname.md deleted file mode 100644 index 3d9aadb52..000000000 --- a/docs/src/utils/logname.md +++ /dev/null @@ -1,3 +0,0 @@ -# logname - -{{ #include ../../_generated/logname-help.md }} diff --git a/docs/src/utils/ls.md b/docs/src/utils/ls.md deleted file mode 100644 index 8476a4772..000000000 --- a/docs/src/utils/ls.md +++ /dev/null @@ -1,3 +0,0 @@ -# ls - -{{ #include ../../_generated/ls-help.md }} diff --git a/docs/src/utils/mkdir.md b/docs/src/utils/mkdir.md deleted file mode 100644 index 896f6e933..000000000 --- a/docs/src/utils/mkdir.md +++ /dev/null @@ -1,3 +0,0 @@ -# mkdir - -{{ #include ../../_generated/mkdir-help.md }} diff --git a/docs/src/utils/mkfifo.md b/docs/src/utils/mkfifo.md deleted file mode 100644 index 7b7514722..000000000 --- a/docs/src/utils/mkfifo.md +++ /dev/null @@ -1,3 +0,0 @@ -# mkfifo - -{{ #include ../../_generated/mkfifo-help.md }} diff --git a/docs/src/utils/mknod.md b/docs/src/utils/mknod.md deleted file mode 100644 index e5c44b883..000000000 --- a/docs/src/utils/mknod.md +++ /dev/null @@ -1,3 +0,0 @@ -# mknod - -{{ #include ../../_generated/mknod-help.md }} diff --git a/docs/src/utils/mktemp.md b/docs/src/utils/mktemp.md deleted file mode 100644 index 445dc6872..000000000 --- a/docs/src/utils/mktemp.md +++ /dev/null @@ -1,3 +0,0 @@ -# mktemp - -{{ #include ../../_generated/mktemp-help.md }} diff --git a/docs/src/utils/more.md b/docs/src/utils/more.md deleted file mode 100644 index 209832840..000000000 --- a/docs/src/utils/more.md +++ /dev/null @@ -1,3 +0,0 @@ -# more - -{{ #include ../../_generated/more-help.md }} diff --git a/docs/src/utils/mv.md b/docs/src/utils/mv.md deleted file mode 100644 index 7e72d9c6d..000000000 --- a/docs/src/utils/mv.md +++ /dev/null @@ -1,3 +0,0 @@ -# mv - -{{ #include ../../_generated/mv-help.md }} diff --git a/docs/src/utils/nice.md b/docs/src/utils/nice.md deleted file mode 100644 index ab304bff0..000000000 --- a/docs/src/utils/nice.md +++ /dev/null @@ -1,3 +0,0 @@ -# nice - -{{ #include ../../_generated/nice-help.md }} diff --git a/docs/src/utils/nl.md b/docs/src/utils/nl.md deleted file mode 100644 index b1f24f064..000000000 --- a/docs/src/utils/nl.md +++ /dev/null @@ -1,3 +0,0 @@ -# nl - -{{ #include ../../_generated/nl-help.md }} diff --git a/docs/src/utils/nohup.md b/docs/src/utils/nohup.md deleted file mode 100644 index 367254bee..000000000 --- a/docs/src/utils/nohup.md +++ /dev/null @@ -1,3 +0,0 @@ -# nohup - -{{ #include ../../_generated/nohup-help.md }} diff --git a/docs/src/utils/nproc.md b/docs/src/utils/nproc.md deleted file mode 100644 index b4ef4eaa4..000000000 --- a/docs/src/utils/nproc.md +++ /dev/null @@ -1,3 +0,0 @@ -# nproc - -{{ #include ../../_generated/nproc-help.md }} diff --git a/docs/src/utils/numfmt.md b/docs/src/utils/numfmt.md deleted file mode 100644 index f811efbaa..000000000 --- a/docs/src/utils/numfmt.md +++ /dev/null @@ -1,3 +0,0 @@ -# numfmt - -{{ #include ../../_generated/numfmt-help.md }} diff --git a/docs/src/utils/od.md b/docs/src/utils/od.md deleted file mode 100644 index 8b366b8fd..000000000 --- a/docs/src/utils/od.md +++ /dev/null @@ -1,3 +0,0 @@ -# od - -{{ #include ../../_generated/od-help.md }} diff --git a/docs/src/utils/paste.md b/docs/src/utils/paste.md deleted file mode 100644 index 86038f1a8..000000000 --- a/docs/src/utils/paste.md +++ /dev/null @@ -1,3 +0,0 @@ -# paste - -{{ #include ../../_generated/paste-help.md }} diff --git a/docs/src/utils/pathchk.md b/docs/src/utils/pathchk.md deleted file mode 100644 index f04139eec..000000000 --- a/docs/src/utils/pathchk.md +++ /dev/null @@ -1,3 +0,0 @@ -# pathchk - -{{ #include ../../_generated/pathchk-help.md }} diff --git a/docs/src/utils/pinky.md b/docs/src/utils/pinky.md deleted file mode 100644 index 1efe4ff45..000000000 --- a/docs/src/utils/pinky.md +++ /dev/null @@ -1,3 +0,0 @@ -# pinky - -{{ #include ../../_generated/pinky-help.md }} diff --git a/docs/src/utils/pr.md b/docs/src/utils/pr.md deleted file mode 100644 index 82b9c938d..000000000 --- a/docs/src/utils/pr.md +++ /dev/null @@ -1,3 +0,0 @@ -# pr - -{{ #include ../../_generated/pr-help.md }} diff --git a/docs/src/utils/printenv.md b/docs/src/utils/printenv.md deleted file mode 100644 index 5543f1e13..000000000 --- a/docs/src/utils/printenv.md +++ /dev/null @@ -1,3 +0,0 @@ -# printenv - -{{ #include ../../_generated/printenv-help.md }} diff --git a/docs/src/utils/printf.md b/docs/src/utils/printf.md deleted file mode 100644 index e11fff3df..000000000 --- a/docs/src/utils/printf.md +++ /dev/null @@ -1,3 +0,0 @@ -# printf - -{{ #include ../../_generated/printf-help.md }} diff --git a/docs/src/utils/ptx.md b/docs/src/utils/ptx.md deleted file mode 100644 index e755a058d..000000000 --- a/docs/src/utils/ptx.md +++ /dev/null @@ -1,3 +0,0 @@ -# ptx - -{{ #include ../../_generated/ptx-help.md }} diff --git a/docs/src/utils/pwd.md b/docs/src/utils/pwd.md deleted file mode 100644 index b3122b336..000000000 --- a/docs/src/utils/pwd.md +++ /dev/null @@ -1,3 +0,0 @@ -# pwd - -{{ #include ../../_generated/pwd-help.md }} diff --git a/docs/src/utils/readlink.md b/docs/src/utils/readlink.md deleted file mode 100644 index 56db08517..000000000 --- a/docs/src/utils/readlink.md +++ /dev/null @@ -1,3 +0,0 @@ -# readlink - -{{ #include ../../_generated/readlink-help.md }} diff --git a/docs/src/utils/realpath.md b/docs/src/utils/realpath.md deleted file mode 100644 index 22bc83475..000000000 --- a/docs/src/utils/realpath.md +++ /dev/null @@ -1,3 +0,0 @@ -# realpath - -{{ #include ../../_generated/realpath-help.md }} diff --git a/docs/src/utils/relpath.md b/docs/src/utils/relpath.md deleted file mode 100644 index 51acd2c87..000000000 --- a/docs/src/utils/relpath.md +++ /dev/null @@ -1,3 +0,0 @@ -# relpath - -{{ #include ../../_generated/relpath-help.md }} diff --git a/docs/src/utils/rm.md b/docs/src/utils/rm.md deleted file mode 100644 index dfb24f242..000000000 --- a/docs/src/utils/rm.md +++ /dev/null @@ -1,3 +0,0 @@ -# rm - -{{ #include ../../_generated/rm-help.md }} diff --git a/docs/src/utils/rmdir.md b/docs/src/utils/rmdir.md deleted file mode 100644 index 1c8d5f205..000000000 --- a/docs/src/utils/rmdir.md +++ /dev/null @@ -1,3 +0,0 @@ -# rmdir - -{{ #include ../../_generated/rmdir-help.md }} diff --git a/docs/src/utils/runcon.md b/docs/src/utils/runcon.md deleted file mode 100644 index 011361492..000000000 --- a/docs/src/utils/runcon.md +++ /dev/null @@ -1,3 +0,0 @@ -# runcon - -{{ #include ../../_generated/runcon-help.md }} diff --git a/docs/src/utils/seq.md b/docs/src/utils/seq.md deleted file mode 100644 index 23fdf04cf..000000000 --- a/docs/src/utils/seq.md +++ /dev/null @@ -1,3 +0,0 @@ -# seq - -{{ #include ../../_generated/seq-help.md }} diff --git a/docs/src/utils/shred.md b/docs/src/utils/shred.md deleted file mode 100644 index 4eae89785..000000000 --- a/docs/src/utils/shred.md +++ /dev/null @@ -1,3 +0,0 @@ -# shred - -{{ #include ../../_generated/shred-help.md }} diff --git a/docs/src/utils/shuf.md b/docs/src/utils/shuf.md deleted file mode 100644 index 1d898ef65..000000000 --- a/docs/src/utils/shuf.md +++ /dev/null @@ -1,3 +0,0 @@ -# shuf - -{{ #include ../../_generated/shuf-help.md }} diff --git a/docs/src/utils/sleep.md b/docs/src/utils/sleep.md deleted file mode 100644 index c115868b3..000000000 --- a/docs/src/utils/sleep.md +++ /dev/null @@ -1,3 +0,0 @@ -# sleep - -{{ #include ../../_generated/sleep-help.md }} diff --git a/docs/src/utils/sort.md b/docs/src/utils/sort.md deleted file mode 100644 index 7b66f920f..000000000 --- a/docs/src/utils/sort.md +++ /dev/null @@ -1,3 +0,0 @@ -# sort - -{{ #include ../../_generated/sort-help.md }} diff --git a/docs/src/utils/split.md b/docs/src/utils/split.md deleted file mode 100644 index 0aa795247..000000000 --- a/docs/src/utils/split.md +++ /dev/null @@ -1,3 +0,0 @@ -# split - -{{ #include ../../_generated/split-help.md }} diff --git a/docs/src/utils/stat.md b/docs/src/utils/stat.md deleted file mode 100644 index deb2c57d2..000000000 --- a/docs/src/utils/stat.md +++ /dev/null @@ -1,3 +0,0 @@ -# stat - -{{ #include ../../_generated/stat-help.md }} diff --git a/docs/src/utils/stdbuf.md b/docs/src/utils/stdbuf.md deleted file mode 100644 index d13c3ece0..000000000 --- a/docs/src/utils/stdbuf.md +++ /dev/null @@ -1,3 +0,0 @@ -# stdbuf - -{{ #include ../../_generated/stdbuf-help.md }} diff --git a/docs/src/utils/sum.md b/docs/src/utils/sum.md deleted file mode 100644 index 2475c2d65..000000000 --- a/docs/src/utils/sum.md +++ /dev/null @@ -1,3 +0,0 @@ -# sum - -{{ #include ../../_generated/sum-help.md }} diff --git a/docs/src/utils/sync.md b/docs/src/utils/sync.md deleted file mode 100644 index 5a8d393bd..000000000 --- a/docs/src/utils/sync.md +++ /dev/null @@ -1,3 +0,0 @@ -# sync - -{{ #include ../../_generated/sync-help.md }} diff --git a/docs/src/utils/tac.md b/docs/src/utils/tac.md deleted file mode 100644 index 914f2d372..000000000 --- a/docs/src/utils/tac.md +++ /dev/null @@ -1,3 +0,0 @@ -# tac - -{{ #include ../../_generated/tac-help.md }} diff --git a/docs/src/utils/tail.md b/docs/src/utils/tail.md deleted file mode 100644 index 35863797e..000000000 --- a/docs/src/utils/tail.md +++ /dev/null @@ -1,3 +0,0 @@ -# tail - -{{ #include ../../_generated/tail-help.md }} diff --git a/docs/src/utils/tee.md b/docs/src/utils/tee.md deleted file mode 100644 index b845a75e5..000000000 --- a/docs/src/utils/tee.md +++ /dev/null @@ -1,3 +0,0 @@ -# tee - -{{ #include ../../_generated/tee-help.md }} diff --git a/docs/src/utils/test.md b/docs/src/utils/test.md deleted file mode 100644 index e02ba1157..000000000 --- a/docs/src/utils/test.md +++ /dev/null @@ -1,3 +0,0 @@ -# test - -{{ #include ../../_generated/test-help.md }} diff --git a/docs/src/utils/timeout.md b/docs/src/utils/timeout.md deleted file mode 100644 index d870fa1af..000000000 --- a/docs/src/utils/timeout.md +++ /dev/null @@ -1,3 +0,0 @@ -# timeout - -{{ #include ../../_generated/timeout-help.md }} diff --git a/docs/src/utils/touch.md b/docs/src/utils/touch.md deleted file mode 100644 index d68b4f6e9..000000000 --- a/docs/src/utils/touch.md +++ /dev/null @@ -1,3 +0,0 @@ -# touch - -{{ #include ../../_generated/touch-help.md }} diff --git a/docs/src/utils/tr.md b/docs/src/utils/tr.md deleted file mode 100644 index 39fbfcf6c..000000000 --- a/docs/src/utils/tr.md +++ /dev/null @@ -1,3 +0,0 @@ -# tr - -{{ #include ../../_generated/tr-help.md }} diff --git a/docs/src/utils/true.md b/docs/src/utils/true.md deleted file mode 100644 index c3448c906..000000000 --- a/docs/src/utils/true.md +++ /dev/null @@ -1,3 +0,0 @@ -# true - -{{ #include ../../_generated/true-help.md }} diff --git a/docs/src/utils/truncate.md b/docs/src/utils/truncate.md deleted file mode 100644 index 402d56d68..000000000 --- a/docs/src/utils/truncate.md +++ /dev/null @@ -1,3 +0,0 @@ -# truncate - -{{ #include ../../_generated/truncate-help.md }} diff --git a/docs/src/utils/tsort.md b/docs/src/utils/tsort.md deleted file mode 100644 index a418fa4e7..000000000 --- a/docs/src/utils/tsort.md +++ /dev/null @@ -1,3 +0,0 @@ -# tsort - -{{ #include ../../_generated/tsort-help.md }} diff --git a/docs/src/utils/tty.md b/docs/src/utils/tty.md deleted file mode 100644 index 2c1da1c47..000000000 --- a/docs/src/utils/tty.md +++ /dev/null @@ -1,3 +0,0 @@ -# tty - -{{ #include ../../_generated/tty-help.md }} diff --git a/docs/src/utils/uname.md b/docs/src/utils/uname.md deleted file mode 100644 index 1436d5599..000000000 --- a/docs/src/utils/uname.md +++ /dev/null @@ -1,3 +0,0 @@ -# uname - -{{ #include ../../_generated/uname-help.md }} diff --git a/docs/src/utils/unexpand.md b/docs/src/utils/unexpand.md deleted file mode 100644 index 05a2b33b8..000000000 --- a/docs/src/utils/unexpand.md +++ /dev/null @@ -1,3 +0,0 @@ -# unexpand - -{{ #include ../../_generated/unexpand-help.md }} diff --git a/docs/src/utils/uniq.md b/docs/src/utils/uniq.md deleted file mode 100644 index f9f561e32..000000000 --- a/docs/src/utils/uniq.md +++ /dev/null @@ -1,3 +0,0 @@ -# uniq - -{{ #include ../../_generated/uniq-help.md }} diff --git a/docs/src/utils/unlink.md b/docs/src/utils/unlink.md deleted file mode 100644 index 5888bb2a8..000000000 --- a/docs/src/utils/unlink.md +++ /dev/null @@ -1,3 +0,0 @@ -# unlink - -{{ #include ../../_generated/unlink-help.md }} diff --git a/docs/src/utils/uptime.md b/docs/src/utils/uptime.md deleted file mode 100644 index 336a5edd9..000000000 --- a/docs/src/utils/uptime.md +++ /dev/null @@ -1,3 +0,0 @@ -# uptime - -{{ #include ../../_generated/uptime-help.md }} diff --git a/docs/src/utils/users.md b/docs/src/utils/users.md deleted file mode 100644 index de20c96ed..000000000 --- a/docs/src/utils/users.md +++ /dev/null @@ -1,3 +0,0 @@ -# users - -{{ #include ../../_generated/users-help.md }} diff --git a/docs/src/utils/wc.md b/docs/src/utils/wc.md deleted file mode 100644 index c5fffdeab..000000000 --- a/docs/src/utils/wc.md +++ /dev/null @@ -1,3 +0,0 @@ -# wc - -{{ #include ../../_generated/wc-help.md }} diff --git a/docs/src/utils/who.md b/docs/src/utils/who.md deleted file mode 100644 index 9cd7f5ba7..000000000 --- a/docs/src/utils/who.md +++ /dev/null @@ -1,3 +0,0 @@ -# who - -{{ #include ../../_generated/who-help.md }} diff --git a/docs/src/utils/whoami.md b/docs/src/utils/whoami.md deleted file mode 100644 index 4e896a30a..000000000 --- a/docs/src/utils/whoami.md +++ /dev/null @@ -1,3 +0,0 @@ -# whoami - -{{ #include ../../_generated/whoami-help.md }} diff --git a/docs/src/utils/yes.md b/docs/src/utils/yes.md deleted file mode 100644 index fbf18307a..000000000 --- a/docs/src/utils/yes.md +++ /dev/null @@ -1,3 +0,0 @@ -# yes - -{{ #include ../../_generated/yes-help.md }} diff --git a/src/bin/uudoc.rs b/src/bin/uudoc.rs index 1b0376189..d7e723b52 100644 --- a/src/bin/uudoc.rs +++ b/src/bin/uudoc.rs @@ -13,11 +13,14 @@ use std::io::Write; include!(concat!(env!("OUT_DIR"), "/uutils_map.rs")); -fn main() { +fn main() -> std::io::Result<()> { let utils = util_map::>>(); - + match std::fs::create_dir("docs/src/utils/") { + Err(e) if e.kind() == std::io::ErrorKind::AlreadyExists => Ok(()), + x => x, + }?; for (name, (_, app)) in utils { - let p = format!("docs/_generated/{}-help.md", name); + let p = format!("docs/src/utils/{}.md", name); if let Ok(f) = File::create(&p) { write_markdown(f, &mut app(), name); println!("Wrote to '{}'", p); @@ -25,9 +28,11 @@ fn main() { println!("Error writing to {}", p); } } + Ok(()) } fn write_markdown(mut w: impl Write, app: &mut App, name: &str) { + let _ = write!(w, "# {}\n\n", name); write_version(&mut w, app); write_usage(&mut w, app, name); write_summary(&mut w, app); From b2c7177106c45ada76b9df79b2426dc52688527c Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Fri, 21 Jan 2022 23:24:10 +0100 Subject: [PATCH 12/15] docs: get installation instructions directly from README.md --- README.md | 2 + docs/src/installation.md | 223 +-------------------------------------- 2 files changed, 3 insertions(+), 222 deletions(-) diff --git a/README.md b/README.md index 306ca08a7..f9ee6a867 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ have other issues. Rust provides a good, platform-agnostic way of writing systems utilities that are easy to compile anywhere, and this is as good a way as any to try and learn it. + ## Requirements * Rust (`cargo`, `rustc`) @@ -252,6 +253,7 @@ To uninstall from a custom parent directory: # DESTDIR is also supported $ make PREFIX=/my/path uninstall ``` + ## Test Instructions diff --git a/docs/src/installation.md b/docs/src/installation.md index 7cf8a7f2b..885b5ecb0 100644 --- a/docs/src/installation.md +++ b/docs/src/installation.md @@ -1,224 +1,3 @@ - # Installation -## Requirements - -* Rust (`cargo`, `rustc`) -* GNU Make (optional) - -### Rust Version - -uutils follows Rust's release channels and is tested against stable, beta and nightly. -The current oldest supported version of the Rust compiler is `1.54`. - -On both Windows and Redox, only the nightly version is tested currently. - -## Build Instructions - -There are currently two methods to build the uutils binaries: either Cargo -or GNU Make. - -> Building the full package, including all documentation, requires both Cargo -> and Gnu Make on a Unix platform. - -For either method, we first need to fetch the repository: - -```bash -$ git clone https://github.com/uutils/coreutils -$ cd coreutils -``` - -### Cargo - -Building uutils using Cargo is easy because the process is the same as for -every other Rust program: - -```bash -$ cargo build --release -``` - -This command builds the most portable common core set of uutils into a multicall -(BusyBox-type) binary, named 'coreutils', on most Rust-supported platforms. - -Additional platform-specific uutils are often available. Building these -expanded sets of uutils for a platform (on that platform) is as simple as -specifying it as a feature: - -```bash -$ cargo build --release --features macos -# or ... -$ cargo build --release --features windows -# or ... -$ cargo build --release --features unix -``` - -If you don't want to build every utility available on your platform into the -final binary, you can also specify which ones you want to build manually. -For example: - -```bash -$ cargo build --features "base32 cat echo rm" --no-default-features -``` - -If you don't want to build the multicall binary and would prefer to build -the utilities as individual binaries, that is also possible. Each utility -is contained in its own package within the main repository, named -"uu_UTILNAME". To build individual utilities, use cargo to build just the -specific packages (using the `--package` [aka `-p`] option). For example: - -```bash -$ cargo build -p uu_base32 -p uu_cat -p uu_echo -p uu_rm -``` - -### GNU Make - -Building using `make` is a simple process as well. - -To simply build all available utilities: - -```bash -$ make -``` - -To build all but a few of the available utilities: - -```bash -$ make SKIP_UTILS='UTILITY_1 UTILITY_2' -``` - -To build only a few of the available utilities: - -```bash -$ make UTILS='UTILITY_1 UTILITY_2' -``` - -## Installation Instructions - -### Cargo - -Likewise, installing can simply be done using: - -```bash -$ cargo install --path . -``` - -This command will install uutils into Cargo's *bin* folder (*e.g.* `$HOME/.cargo/bin`). - -This does not install files necessary for shell completion. For shell completion to work, -use `GNU Make` or see `Manually install shell completions`. - -### GNU Make - -To install all available utilities: - -```bash -$ make install -``` - -To install using `sudo` switch `-E` must be used: - -```bash -$ sudo -E make install -``` - -To install all but a few of the available utilities: - -```bash -$ make SKIP_UTILS='UTILITY_1 UTILITY_2' install -``` - -To install only a few of the available utilities: - -```bash -$ make UTILS='UTILITY_1 UTILITY_2' install -``` - -To install every program with a prefix (e.g. uu-echo uu-cat): - -```bash -$ make PROG_PREFIX=PREFIX_GOES_HERE install -``` - -To install the multicall binary: - -```bash -$ make MULTICALL=y install -``` - -Set install parent directory (default value is /usr/local): - -```bash -# DESTDIR is also supported -$ make PREFIX=/my/path install -``` - -Installing with `make` installs shell completions for all installed utilities -for `bash`, `fish` and `zsh`. Completions for `elvish` and `powershell` can also -be generated; See `Manually install shell completions`. - -### NixOS - -The [standard package set](https://nixos.org/nixpkgs/manual/) of [NixOS](https://nixos.org/) -provides this package out of the box since 18.03: - -```shell -$ nix-env -iA nixos.uutils-coreutils -``` - -### Manually install shell completions - -The `coreutils` binary can generate completions for the `bash`, `elvish`, `fish`, `powershell` -and `zsh` shells. It prints the result to stdout. - -The syntax is: -```bash -cargo run completion -``` - -So, to install completions for `ls` on `bash` to `/usr/local/share/bash-completion/completions/ls`, -run: - -```bash -cargo run completion ls bash > /usr/local/share/bash-completion/completions/ls -``` - -## Un-installation Instructions - -Un-installation differs depending on how you have installed uutils. If you used -Cargo to install, use Cargo to uninstall. If you used GNU Make to install, use -Make to uninstall. - -### Cargo - -To uninstall uutils: - -```bash -$ cargo uninstall uutils -``` - -### GNU Make - -To uninstall all utilities: - -```bash -$ make uninstall -``` - -To uninstall every program with a set prefix: - -```bash -$ make PROG_PREFIX=PREFIX_GOES_HERE uninstall -``` - -To uninstall the multicall binary: - -```bash -$ make MULTICALL=y uninstall -``` - -To uninstall from a custom parent directory: - -```bash -# DESTDIR is also supported -$ make PREFIX=/my/path uninstall -``` +{{#include ../../README.md:installation }} \ No newline at end of file From a3ca29b6128da26ed14ede13e21c9ce1a4fb36da Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Sat, 22 Jan 2022 11:39:07 +0100 Subject: [PATCH 13/15] docs: create SUMMARY.md automatically --- docs/.gitignore | 1 + docs/create_docs.py | 12 ----- docs/src/SUMMARY.md | 108 -------------------------------------------- docs/theme/head.hbs | 5 +- src/bin/uudoc.rs | 101 +++++++++++++++++++++++++---------------- 5 files changed, 66 insertions(+), 161 deletions(-) delete mode 100644 docs/create_docs.py delete mode 100644 docs/src/SUMMARY.md diff --git a/docs/.gitignore b/docs/.gitignore index f06cae769..f2b5c7168 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1,2 +1,3 @@ book src/utils +src/SUMMARY.md diff --git a/docs/create_docs.py b/docs/create_docs.py deleted file mode 100644 index 2fde09e55..000000000 --- a/docs/create_docs.py +++ /dev/null @@ -1,12 +0,0 @@ -# Simple script to create the correct SUMMARY.md and other files -# for the mdbook documentation. -# Note: This will overwrite the existing files! - -import os - -with open('src/SUMMARY.md', 'w') as summary: - summary.write("# Summary\n\n") - summary.write("[Introduction](index.md)\n") - summary.write("* [Contributing](contributing.md)\n") - for d in sorted(os.listdir('../src/uu')): - summary.write(f"* [{d}](utils/{d}.md)\n") \ No newline at end of file diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md deleted file mode 100644 index 02001b08c..000000000 --- a/docs/src/SUMMARY.md +++ /dev/null @@ -1,108 +0,0 @@ -# Summary - -[Introduction](index.md) -* [Installation](installation.md) -* [Contributing](contributing.md) - -# Reference -* [Multi-call binary](multicall.md) -* [arch](utils/arch.md) -* [base32](utils/base32.md) -* [base64](utils/base64.md) -* [basename](utils/basename.md) -* [basenc](utils/basenc.md) -* [cat](utils/cat.md) -* [chcon](utils/chcon.md) -* [chgrp](utils/chgrp.md) -* [chmod](utils/chmod.md) -* [chown](utils/chown.md) -* [chroot](utils/chroot.md) -* [cksum](utils/cksum.md) -* [comm](utils/comm.md) -* [cp](utils/cp.md) -* [csplit](utils/csplit.md) -* [cut](utils/cut.md) -* [date](utils/date.md) -* [dd](utils/dd.md) -* [df](utils/df.md) -* [dircolors](utils/dircolors.md) -* [dirname](utils/dirname.md) -* [du](utils/du.md) -* [echo](utils/echo.md) -* [env](utils/env.md) -* [expand](utils/expand.md) -* [expr](utils/expr.md) -* [factor](utils/factor.md) -* [false](utils/false.md) -* [fmt](utils/fmt.md) -* [fold](utils/fold.md) -* [groups](utils/groups.md) -* [hashsum](utils/hashsum.md) -* [head](utils/head.md) -* [hostid](utils/hostid.md) -* [hostname](utils/hostname.md) -* [id](utils/id.md) -* [install](utils/install.md) -* [join](utils/join.md) -* [kill](utils/kill.md) -* [link](utils/link.md) -* [ln](utils/ln.md) -* [logname](utils/logname.md) -* [ls](utils/ls.md) -* [mkdir](utils/mkdir.md) -* [mkfifo](utils/mkfifo.md) -* [mknod](utils/mknod.md) -* [mktemp](utils/mktemp.md) -* [more](utils/more.md) -* [mv](utils/mv.md) -* [nice](utils/nice.md) -* [nl](utils/nl.md) -* [nohup](utils/nohup.md) -* [nproc](utils/nproc.md) -* [numfmt](utils/numfmt.md) -* [od](utils/od.md) -* [paste](utils/paste.md) -* [pathchk](utils/pathchk.md) -* [pinky](utils/pinky.md) -* [pr](utils/pr.md) -* [printenv](utils/printenv.md) -* [printf](utils/printf.md) -* [ptx](utils/ptx.md) -* [pwd](utils/pwd.md) -* [readlink](utils/readlink.md) -* [realpath](utils/realpath.md) -* [relpath](utils/relpath.md) -* [rm](utils/rm.md) -* [rmdir](utils/rmdir.md) -* [runcon](utils/runcon.md) -* [seq](utils/seq.md) -* [shred](utils/shred.md) -* [shuf](utils/shuf.md) -* [sleep](utils/sleep.md) -* [sort](utils/sort.md) -* [split](utils/split.md) -* [stat](utils/stat.md) -* [stdbuf](utils/stdbuf.md) -* [sum](utils/sum.md) -* [sync](utils/sync.md) -* [tac](utils/tac.md) -* [tail](utils/tail.md) -* [tee](utils/tee.md) -* [test](utils/test.md) -* [timeout](utils/timeout.md) -* [touch](utils/touch.md) -* [tr](utils/tr.md) -* [true](utils/true.md) -* [truncate](utils/truncate.md) -* [tsort](utils/tsort.md) -* [tty](utils/tty.md) -* [uname](utils/uname.md) -* [unexpand](utils/unexpand.md) -* [uniq](utils/uniq.md) -* [unlink](utils/unlink.md) -* [uptime](utils/uptime.md) -* [users](utils/users.md) -* [wc](utils/wc.md) -* [who](utils/who.md) -* [whoami](utils/whoami.md) -* [yes](utils/yes.md) diff --git a/docs/theme/head.hbs b/docs/theme/head.hbs index 7ce6ac83c..31cc2dad5 100644 --- a/docs/theme/head.hbs +++ b/docs/theme/head.hbs @@ -10,4 +10,7 @@ top: 1em; right: 0; } - \ No newline at end of file + dd > p { + margin-top: 0.2em; + } + diff --git a/src/bin/uudoc.rs b/src/bin/uudoc.rs index d7e723b52..0a3bf9837 100644 --- a/src/bin/uudoc.rs +++ b/src/bin/uudoc.rs @@ -1,7 +1,5 @@ // This file is part of the uutils coreutils package. // -// (c) Michael Gehring -// // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. @@ -9,74 +7,97 @@ use clap::App; use std::collections::hash_map::HashMap; use std::ffi::OsString; use std::fs::File; -use std::io::Write; +use std::io::{self, Write}; include!(concat!(env!("OUT_DIR"), "/uutils_map.rs")); -fn main() -> std::io::Result<()> { +fn main() -> io::Result<()> { let utils = util_map::>>(); match std::fs::create_dir("docs/src/utils/") { Err(e) if e.kind() == std::io::ErrorKind::AlreadyExists => Ok(()), x => x, }?; - for (name, (_, app)) in utils { + + let mut summary = File::create("docs/src/SUMMARY.md")?; + + let _ = write!( + summary, + "# Summary\n\ + \n\ + [Introduction](index.md)\n\ + * [Installation](installation.md)\n\ + * [Contributing](contributing.md)\n\ + \n\ + # Reference\n\ + * [Multi-call binary](multicall.md)\n", + ); + + let mut utils = utils.iter().collect::>(); + utils.sort(); + for (&name, (_, app)) in utils { + if name == "[" { + continue; + } let p = format!("docs/src/utils/{}.md", name); if let Ok(f) = File::create(&p) { - write_markdown(f, &mut app(), name); + write_markdown(f, &mut app(), name)?; println!("Wrote to '{}'", p); } else { println!("Error writing to {}", p); } + write!(summary, "* [{0}](utils/{0}.md)\n", name)? } Ok(()) } -fn write_markdown(mut w: impl Write, app: &mut App, name: &str) { - let _ = write!(w, "# {}\n\n", name); - write_version(&mut w, app); - write_usage(&mut w, app, name); - write_summary(&mut w, app); - write_options(&mut w, app); +fn write_markdown(mut w: impl Write, app: &mut App, name: &str) -> io::Result<()> { + write!(w, "# {}\n\n", name)?; + write_version(&mut w, app)?; + write_usage(&mut w, app, name)?; + write_description(&mut w, app)?; + write_options(&mut w, app) } -fn write_version(w: &mut impl Write, app: &App) { - let _ = writeln!( +fn write_version(w: &mut impl Write, app: &App) -> io::Result<()> { + writeln!( w, "
version: {}
", app.render_version().split_once(' ').unwrap().1 - ); + ) } -fn write_usage(w: &mut impl Write, app: &mut App, name: &str) { - let _ = writeln!(w, "\n```"); +fn write_usage(w: &mut impl Write, app: &mut App, name: &str) -> io::Result<()> { + writeln!(w, "\n```")?; let mut usage: String = app.render_usage().lines().nth(1).unwrap().trim().into(); usage = usage.replace(app.get_name(), name); - let _ = writeln!(w, "{}", usage); - let _ = writeln!(w, "```"); + writeln!(w, "{}", usage)?; + writeln!(w, "```") } -fn write_summary(w: &mut impl Write, app: &App) { +fn write_description(w: &mut impl Write, app: &App) -> io::Result<()> { if let Some(about) = app.get_long_about().or_else(|| app.get_about()) { - let _ = writeln!(w, "{}", about); + writeln!(w, "{}", about) + } else { + Ok(()) } } -fn write_options(w: &mut impl Write, app: &App) { - let _ = writeln!(w, "

Options

"); - let _ = write!(w, "
"); +fn write_options(w: &mut impl Write, app: &App) -> io::Result<()> { + writeln!(w, "

Options

")?; + write!(w, "
")?; for arg in app.get_arguments() { - let _ = write!(w, "
"); + write!(w, "
")?; let mut first = true; for l in arg.get_long_and_visible_aliases().unwrap_or_default() { if !first { - let _ = write!(w, ", "); + write!(w, ", ")?; } else { first = false; } - let _ = write!(w, ""); - let _ = write!(w, "--{}", l); + write!(w, "")?; + write!(w, "--{}", l)?; if let Some(names) = arg.get_value_names() { - let _ = write!( + write!( w, "={}", names @@ -84,20 +105,20 @@ fn write_options(w: &mut impl Write, app: &App) { .map(|x| format!("<{}>", x)) .collect::>() .join(" ") - ); + )?; } - let _ = write!(w, ""); + write!(w, "")?; } for s in arg.get_short_and_visible_aliases().unwrap_or_default() { if !first { - let _ = write!(w, ", "); + write!(w, ", ")?; } else { first = false; } - let _ = write!(w, ""); - let _ = write!(w, "-{}", s); + write!(w, "")?; + write!(w, "-{}", s)?; if let Some(names) = arg.get_value_names() { - let _ = write!( + write!( w, " {}", names @@ -105,12 +126,12 @@ fn write_options(w: &mut impl Write, app: &App) { .map(|x| format!("<{}>", x)) .collect::>() .join(" ") - ); + )?; } - let _ = write!(w, ""); + write!(w, "")?; } - let _ = writeln!(w, "
"); - let _ = writeln!(w, "
{}
", arg.get_help().unwrap_or_default()); + writeln!(w, "")?; + writeln!(w, "
\n\n{}\n\n
", arg.get_help().unwrap_or_default())?; } - let _ = writeln!(w, "
"); + writeln!(w, "
") } From d896ccfd904c6f7e822b66b4e5fa4cba0c93ebc3 Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Sat, 22 Jan 2022 11:51:41 +0100 Subject: [PATCH 14/15] docs: fix links in introduction --- docs/src/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/index.md b/docs/src/index.md index 52490f41d..3ea5d913a 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -6,9 +6,9 @@ Linux, Windows, Mac and other platforms. The API reference for `uucore`, the library of functions shared between various utils, is hosted at at -[docs.rs](https://docs.rs/uucore/0.0.12/uucore/). +[docs.rs](https://docs.rs/uucore/latest/uucore/). -uutils is licensed under the [MIT License](https://github.com/uutils/coreutils/LICENSE.md). +uutils is licensed under the [MIT License](https://github.com/uutils/coreutils/blob/main/LICENSE). ## Useful links * [Releases](https://github.com/uutils/coreutils/releases) From a575932115806c607ab2fda1d5543bc9e9b37c3e Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Sat, 22 Jan 2022 11:59:41 +0100 Subject: [PATCH 15/15] uudoc: fix clippy lint --- src/bin/uudoc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/uudoc.rs b/src/bin/uudoc.rs index 0a3bf9837..38e8a0323 100644 --- a/src/bin/uudoc.rs +++ b/src/bin/uudoc.rs @@ -45,7 +45,7 @@ fn main() -> io::Result<()> { } else { println!("Error writing to {}", p); } - write!(summary, "* [{0}](utils/{0}.md)\n", name)? + writeln!(summary, "* [{0}](utils/{0}.md)", name)? } Ok(()) }