From e49d6d0409401f2c568b4e23a378e0c755a6e073 Mon Sep 17 00:00:00 2001 From: Gustav Eek Date: Thu, 2 Feb 2023 09:11:44 +0100 Subject: [PATCH] Doc. Update usage documentation and add a CLI document. --- README | 19 +++++++++++++++++-- doc/cli.md | 18 ++++++++++++++++++ doc/dependencies.md | 2 +- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 doc/cli.md diff --git a/README b/README index 25fbf9f..dc67204 100644 --- a/README +++ b/README @@ -6,8 +6,9 @@ Decide an available distribution, e.g. the log normal, and apply the quantiles from that on a ranked priority list. The output will be the priority in percentages per item in the list. -Read more in [Notes on statistics in Rust](doc/stats.md) on the -details of implementation. +Read more in [Notes on statistics in Rust](doc/stats.md) and +[Notes on command line parsing](doc/cli.md) +on the details of implementation. Also read [Notes on dependencies](doc/dependencies.md) for an essay on Rust. @@ -28,6 +29,20 @@ Write to the author in order to request binaries for your platform. No warranties of a response. +Usage +===== + +Rank N' Auto, reads and writes on standard input and output. Some +statistics parameters can be adjusted, see help for details: +`ranknauto --help`. + +Examples: + +``` +echo -ne "Första post\nAndra\nTredje plats\nOch fjärde\n" \ + | ranknauto -s heavy +``` + Copying ======= diff --git a/doc/cli.md b/doc/cli.md new file mode 100644 index 0000000..330b223 --- /dev/null +++ b/doc/cli.md @@ -0,0 +1,18 @@ +--- +title: Notes on command line parsing +author: Gustav Eek +date: 2 feb 2023 +--- + + + +Rank N' Auto uses [Clap](https://lib.rs/crates/clap) for command line +configuration and the declarative style. + +Clap supports three styles for specification (1) *derived*, +declaratively with a struct and some attributes, (2) *builder*, +several arguments using usage strings, and (3) as a YAML +*configuration file*.x diff --git a/doc/dependencies.md b/doc/dependencies.md index 00c7adf..70d4844 100644 --- a/doc/dependencies.md +++ b/doc/dependencies.md @@ -14,7 +14,7 @@ versions of Rust. Also, though the immediate list is short, dependencies stretch. My apologies. I regret that the general Rust configuration is immature. It is -careless from a community perspective not to put more effort into +careless from a community perspective, not to put more effort into ensuring that versions distributed through e.g. Debian work in the majority of cases. -- 2.39.2