From 1320c15f126def16799af6be79aeaba4da2d827d Mon Sep 17 00:00:00 2001 From: Adam Szkoda Date: Wed, 7 Jun 2023 18:28:27 +0200 Subject: [PATCH] Update README --- README.md | 17 ++++++++++++----- usage/cargo.usage | 4 +++- usage/darcs.usage | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7ff4c41..3a7b6be 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,9 @@ See the [subdirectory](usage/) for examples. The grammar is based on [compleat](https://github.com/mbrubeck/compleat/blob/master/README.markdown#syntax)'s one. +A grammar is a series of line terminated by a semicolon (;). Each line (roughly) represents a single variant of +invoking the command. + * `a b` matches `a` followed by `b`. * `a b | c` matches either `a b` or `c`. * `[a]` matches zero or one occurrences of `a`. @@ -66,17 +69,21 @@ Use parentheses to group patterns: # Roadmap - * Generate grammars automatically from man pages similarly to [how Fish shell is does it](https://github.com/fish-shell/fish-shell/blob/946ecf235c002cff596fbbb2c03f9693c30744da/share/tools/create_manpage_completions.py). - - * Show completion hints in ZSH and Fish (Bash does not support them). + * Printing of undefined variables as a gentle warning. * `name ::= expression;` defines a new production that can be referred to from other productions via `` syntax. Referring to a production recursively won't be supported as that would take us outside of regular languages. + * Produce [railroad diagrams](https://github.com/lukaslueg/railroad) to ease grammar development. + + * Automatic completion of standard objects, e.g. , , etc. + + * Generate grammars automatically from man pages similarly to [how Fish shell is does it](https://github.com/fish-shell/fish-shell/blob/946ecf235c002cff596fbbb2c03f9693c30744da/share/tools/create_manpage_completions.py). + + * Show completion hints in ZSH and Fish (Bash does not support them). + * `name = { shell-command... }` defines a variable that uses a shell command to generate suggested completions. The shell command should print one suggested completion per line. The `$COMP_LINE` and `$COMP_CWORD` environment will contain the input line and the current word being completed. - * If no value is defined for `name`, then the pattern `` will match any word. - * End-to-end tests that excercise the generation completion scripts and check that they behave properly. diff --git a/usage/cargo.usage b/usage/cargo.usage index 9a087ab..f3a8c7d 100644 --- a/usage/cargo.usage +++ b/usage/cargo.usage @@ -1,4 +1,6 @@ -cargo [+toolchain] [] []; +cargo [+] [] []; + + ::= { rustup toolchain list | cut -d' ' -f1 }; ::= [-V | --version] [--list] [--explain ] [-v | --verbose...] [-q | --quiet] [--color ] [--frozen] [--locked] [--offline] [--config ] [-Z ] [-h | --help]; ::= (build | b) | (check | c) | clean | (doc | d) | new | init | add | remove | (run | r) | (test | t) | bench | update | search | publish | install | uninstall; ::= [-q | --quiet] [--lib] [--bin []] [--bins] [-v | --verbose]... [--example []] [--color ] [--examples] [--frozen] [--test []] [--locked] [--tests] [--bench []] [--offline] [--benches] [--config ] [--all-targets] [-Z ] [--doc] [--no-run] [--no-fail-fast] [-p | --package []] [--workspace] [--exclude ] [--all] [-j | --jobs ] [--keep-going] [-r | --release] [--profile ] [-F | --features ] [--all-features] [--no-default-features] [--target ] [--target-dir ] [--manifest-path ] [--ignore-rust-version] [--message-format ] [--unit-graph] [--future-incompat-report] [--timings []] [-h | --help]; diff --git a/usage/darcs.usage b/usage/darcs.usage index 4392661..403605f 100644 --- a/usage/darcs.usage +++ b/usage/darcs.usage @@ -1,4 +1,4 @@ -darcs help ( ( --debug | --debug-verbose | --debug-http | ( -v | --verbose ) | ( -q | --quiet ) | --standard-verbosity ) | --timings | ( --posthook | --no-posthook ) | ( --prompt-posthook | --run-posthook ) | ( --prehook | --no-prehook ) | ( --prompt-prehook | --run-prehook ) ) ... [ [DARCS_SUBCOMMAND]] ; +darcs help ( ( --debug | --debug-verbose | --debug-http | ( -v | --verbose ) | ( -q | --quiet ) | --standard-verbosity ) | --timings | ( --posthook | --no-posthook ) | ( --prompt-posthook | --run-posthook ) | ( --prehook | --no-prehook ) | ( --prompt-prehook | --run-prehook ) ) ... [ []] ; darcs add ( --boring | ( --case-ok | --reserved-ok ) | ( ( -r | --recursive ) | --not-recursive ) | ( --date-trick | --no-date-trick ) | --repodir | --dry-run | --umask | ( --debug | --debug-verbose | --debug-http | ( -v | --verbose ) | ( -q | --quiet ) | --standard-verbosity ) | --timings | ( --posthook | --no-posthook ) | ( --prompt-posthook | --run-posthook ) | ( --prehook | --no-prehook ) | ( --prompt-prehook | --run-prehook ) ) ... ( | )...; darcs remove ( --repodir | --umask | ( --debug | --debug-verbose | --debug-http | ( -v | --verbose ) | ( -q | --quiet ) | --standard-verbosity ) | --timings | ( --posthook | --no-posthook ) | ( --prompt-posthook | --run-posthook ) | ( --prehook | --no-prehook ) | ( --prompt-prehook | --run-prehook ) ) ... ( | )...; darcs move ( ( --case-ok | --reserved-ok ) | --repodir | --umask | ( --debug | --debug-verbose | --debug-http | ( -v | --verbose ) | ( -q | --quiet ) | --standard-verbosity ) | --timings | ( --posthook | --no-posthook ) | ( --prompt-posthook | --run-posthook ) | ( --prehook | --no-prehook ) | ( --prompt-prehook | --run-prehook ) ) ... ... ;