From 03faacf44503e4e9fb664f49f6eeab3b3ab88fb2 Mon Sep 17 00:00:00 2001 From: Danila Danko Date: Wed, 14 Feb 2024 15:09:55 +0300 Subject: [PATCH] refactor: commands formatting --- README.md | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 06c2a5494..21420c2da 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,6 @@ You can install the `normalizer-phi` executable globally via [stack](https://doc Then, the `normalize-phi` executable will be available on `PATH` and in `~/.local/bin/` on `Linux` and `macOS`. ```sh -# Commands stack install normalize-phi --help ``` @@ -43,12 +42,16 @@ The `eo-phi-normalizer` package provides an executable `normalize-phi` that has Run the executable via `stack run`. ```sh -# Commands stack run normalize-phi -- --help -# Or +``` + +Or + +```sh stack run -- --help +``` -# Output: +```console Normalizer Usage: normalize-phi [-c|--chain] [--rules-yaml STRING] [-o|--output STRING] @@ -88,10 +91,10 @@ Normalize a 𝜑-expression from `test.phi` using a ruleset (See [Rulesets](#rul There can be multiple numbered results that correspond to multiple rule application sequences. ```sh -# Command stack run -- --rules-yaml ./eo-phi-normalizer/test/eo/phi/rules/yegor.yaml test.phi +``` -# Output +```console Rule set based on Yegor's draft Input: { a ↦ ⟦ b ↦ ⟦ c ↦ ∅, d ↦ ⟦ φ ↦ ξ.ρ.c ⟧ ⟧, e ↦ ξ.b (c ↦ ⟦ ⟧).d ⟧.e } @@ -107,10 +110,10 @@ Normalize an expression using a ruleset (See [Rulesets](#rulesets)). Read the expression from stdin. ```sh -# Command cat test.phi | stack run -- --rules-yaml ./eo-phi-normalizer/test/eo/phi/rules/yegor.yaml +``` -# Output +```console Rule set based on Yegor's draft Input: { a ↦ ⟦ b ↦ ⟦ c ↦ ∅, d ↦ ⟦ φ ↦ ξ.ρ.c ⟧ ⟧, e ↦ ξ.b (c ↦ ⟦ ⟧).d ⟧.e } @@ -121,6 +124,7 @@ Result 1 out of 1: ``` Alternatively, the path to the file containing a Phi expression can be passed as a positional argument: + ```sh stack run -- --rules-yaml ./eo-phi-normalizer/test/eo/phi/rules/yegor.yaml test.phi ``` @@ -130,10 +134,10 @@ stack run -- --rules-yaml ./eo-phi-normalizer/test/eo/phi/rules/yegor.yaml test. Use `--chain` to see numbered normalization steps for each normalization result. ```sh -# Command cat test.phi | stack run -- --chain --rules-yaml ./eo-phi-normalizer/test/eo/phi/rules/yegor.yaml +``` -# Output +```console Rule set based on Yegor's draft Input: { a ↦ ⟦ b ↦ ⟦ c ↦ ∅, d ↦ ⟦ φ ↦ ξ.ρ.c ⟧ ⟧, e ↦ ξ.b (c ↦ ⟦ ⟧).d ⟧.e } @@ -149,10 +153,10 @@ Result 1 out of 1: Use `--single` to print a single normalized program. ```sh -# Command stack run -- --single --rules-yaml ./eo-phi-normalizer/test/eo/phi/rules/yegor.yaml test.phi +``` -# Output +```console ⟦ a ↦ ξ.b (c ↦ ⟦ ⟧).d (ρ ↦ ⟦ b ↦ ⟦ c ↦ ∅, d ↦ ⟦ φ ↦ ξ.ρ.c ⟧ ⟧ ⟧) ⟧ ```