command-line-interface-pages / v2-tooling

Tools for handling v2.*.* syntax
6 stars 3 forks source link

Recognize number noun prefixes with `_or_more` keyword #42

Closed EmilyGraceSeville7cf closed 1 year ago

EmilyGraceSeville7cf commented 1 year ago

Description

Intended to support prefixes:

Motivation

Why? Because it's not always possible to detect how much repetitions are expected. And even if lowest repetition count is detected it's not possible to figure out what the highest limit is: TlDr syntax limitation.

Let's say we have this input: {{path/to/file1}} {{path/to/file1 path/to/file2 ...}}. How to treat it? Is it a one required file and 0..more separate ones? Or they are all the same and 1..more files expected? Placeholder numbering is not standardized in TlDr so that's why it's not something script can rely on (even it should decide how to interpret placeholders).

Example

Implementation details

Such prefixes should be checked before checking arbitrary file prefix like {{path/to/image_file}} to be recognized (in sed code).

šŸ¤” Maybe implement a more reliable parser first as supporting tons of sed regexes is not easy even after refactoring.

EmilyGraceSeville7cf commented 1 year ago

@mfrw, @kbdharun, @navarroaxel, what do u think about such idea? This just requires from you to update TlDr pages to support such prefixes if you support this proposal (or I can do it too). Note that I don't force anybody (and have no interest to) mention this syntax in your style guide, it's up to you as I don't wanna do work that can be easily rejected.

blueskyson commented 1 year ago

Changing {{path/to/file1 path/to/file2 ...}} to {{path/to/one_or_more_files}} sounds feasible in my opinion. But I think {{path/to/file1 path/to/file2 ...}} is a little better for readability.