From 94daed8afbfffcf89f511bfca04c0e905fe75ee1 Mon Sep 17 00:00:00 2001 From: m11o Date: Sat, 6 May 2023 00:34:55 +0900 Subject: [PATCH 1/2] tsort: move help strings to markdown file --- src/uu/tsort/src/tsort.rs | 8 +++----- src/uu/tsort/tsort.md | 9 +++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 src/uu/tsort/tsort.md diff --git a/src/uu/tsort/src/tsort.rs b/src/uu/tsort/src/tsort.rs index cb179699d..a70f32dfd 100644 --- a/src/uu/tsort/src/tsort.rs +++ b/src/uu/tsort/src/tsort.rs @@ -12,12 +12,10 @@ use std::io::{stdin, BufRead, BufReader, Read}; use std::path::Path; use uucore::display::Quotable; use uucore::error::{FromIo, UResult, USimpleError}; -use uucore::format_usage; +use uucore::{format_usage, help_about, help_usage}; -static ABOUT: &str = "Topological sort the strings in FILE. -Strings are defined as any sequence of tokens separated by whitespace (tab, space, or newline). -If FILE is not passed in, stdin is used instead."; -static USAGE: &str = "{} [OPTIONS] FILE"; +const ABOUT: &str = help_about!("tsort.md"); +const USAGE: &str = help_usage!("tsort.md"); mod options { pub const FILE: &str = "file"; diff --git a/src/uu/tsort/tsort.md b/src/uu/tsort/tsort.md new file mode 100644 index 000000000..4a5621a6c --- /dev/null +++ b/src/uu/tsort/tsort.md @@ -0,0 +1,9 @@ +# tsort + +``` +tsort [OPTIONS] FILE +``` + +Topological sort the strings in FILE. +Strings are defined as any sequence of tokens separated by whitespace (tab, space, or newline). +If FILE is not passed in, stdin is used instead. From 8f4367c3bc228885e0f485828569860a6a71dcd7 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 6 May 2023 10:32:18 +0200 Subject: [PATCH 2/2] to make it clearer --- src/uu/tsort/tsort.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/uu/tsort/tsort.md b/src/uu/tsort/tsort.md index 4a5621a6c..5effbf1e7 100644 --- a/src/uu/tsort/tsort.md +++ b/src/uu/tsort/tsort.md @@ -5,5 +5,6 @@ tsort [OPTIONS] FILE ``` Topological sort the strings in FILE. -Strings are defined as any sequence of tokens separated by whitespace (tab, space, or newline). +Strings are defined as any sequence of tokens separated by whitespace (tab, space, or newline), ordering them based on dependencies in a directed acyclic graph (DAG). +Useful for scheduling and determining execution order. If FILE is not passed in, stdin is used instead.