Replies: 4 comments 2 replies
-
|
Ok, after many trials and error, looks like this mght be the most optimal completion, notice how there's no wildcards on the file type. I still get folders despite using $files() |
Beta Was this translation helpful? Give feedback.
-
|
Optarg just means that the argument is optional. -o
-o positionalArgumentNotBelongingToFlag
-o=flagArgumentSo for most of these you problably don't need a suffix at all. |
Beta Was this translation helpful? Give feedback.
-
|
Ok, i think you are looking for # yaml-language-server: $schema=https://carapace.sh/schemas/command.json
name: pngcheck
description: Test PNG, JNG or MNG image files for corruption, and print size/type info.
parsing: non-interspersed
flags:
-c: colorize output (for ANSI terminals)
-p: print contents of PLTE, tRNS, hIST, sPLT and PPL
-q: test quietly (output only errors)
-s: search for PNGs within another file
-t: print contents of tEXt chunks
-v*: test verbosely (print most chunk data)
-w: suppress windowBits test (a more-stringent compression check)
-x: search for PNGs within another file and extract them when found
completion:
positionalany: ["$files([.png, .jng, .mng])"]
|
Beta Was this translation helpful? Give feedback.
-
|
Thanks. Will try it. Is also the comment really necessary? Anyway I'm going on a tangent. I'll see how completion goes on those. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
So I wanted to create my custom completion and first of all, I had to use carapace/specs folder, I asked AI and it told me to use /comp
I copied the settings of the first example to see what it does and undestand how it behaves.
First this page:
https://carapace-sh.github.io/carapace-bin/spec.html
Tells me to go to this page for more info
https://carapace-sh.github.io/carapace-spec/carapace-spec.html
The thing is that then, I don't have the video in the second page, which would have helped me as it shows how optarg? can have values with optarg=foo
Anyway, my big problem is that I want something like this
pncheck -flag (always first, nonrepeateble and optional) filename (only png)I would like flags to complete after I write - and the filename if I don't write anything else. This is my file, nce I put everything after completion, the flags don't complete anymore:
Beta Was this translation helpful? Give feedback.
All reactions