Giter Site home page Giter Site logo

Comments (4)

adaszko avatar adaszko commented on September 28, 2024

Hi, I just did complgen check on the usage file you posted and it doesn't report any errors. Also the jit subcommand output looks good:

$ cargo run -- jit usage/hyprctl.usage bash
    Finished dev [unoptimized + debuginfo] target(s) in 0.03s
     Running `target/debug/complgen jit usage/hyprctl.usage bash`
--batch
--instance
-i
-j
activewindow
activeworkspace
animations
workspaces

I just added the version subcommand. Could you please re-install the latest master of complgen and post the output of complgen version here?

There may be some invisible characters in your usage file that get lost during copy-paste. The off-the-mark error message would support that. If you upload the usage file as some archive (tar, zip) here, I can check.

from complgen.

REALERvolker1 avatar REALERvolker1 commented on September 28, 2024

Did you push your commits? It still says the last commit was yesterday.

When I run the latest git master version of complgen, I get this output:

 ~/src/complgen  ./target/release/complgen --help
Usage: complgen <COMMAND>

Commands:
  check   Do not complete -- only check a grammar file for errors
  jit     Emit completions on stdout
  aot     Write autocompletions shell script file
  scrape  Read `cmd --help` output of another command and emit a grammar
  help    Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help

Also, here is my file.
hyprctl.usage.renamed_extension_for_github_embed.log

from complgen.

adaszko avatar adaszko commented on September 28, 2024

Now it's pushed, sorry. I will check your usage file, thanks

from complgen.

adaszko avatar adaszko commented on September 28, 2024

The larger file that you uploaded triggered the issue. There was a bug in error reporting (thus the off the mark error message) plus another one in checking in grammar ambiguities that. Both are fixed now.

The minimal-ish reproducing example lives in a e2e test case to avoid this in the future:

def test_issue_45(complgen_binary_path: Path):
GRAMMAR = r'''
hyprctl [<OPTION>]... <COMMAND>;
<COMMAND> ::= animations "list animations and beziers (not in --help)"
| switchxkblayout "switch keyboard layout" <DEVICE> (next | prev)
;
<DEVICE> ::= {{{ hyprctl devices -j | awk '/^"keyboards"/,/^\],$/' | sed -n 's/.*"name": "\(.*\)".*/\1/p' }}};
'''
complgen_check(complgen_binary_path, GRAMMAR)

Thanks for reporting! It is a interesting edge case I hadn't thought of!

from complgen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.