clink icon indicating copy to clipboard operation
clink copied to clipboard

Reuse one parser in another parser

Open jfastnacht opened this issue 5 years ago • 0 comments

I'm trying to write a parser for ddev and one of the commands is actually some kind of proxy to run Composer commands within ddev.

composer.lua

local parser = clink.arg.new_parser

local composer_parser = parser(
    {
        "about",
        -- ...
    },
    -- ...
)
clink.arg.register_parser("composer", composer_parser)

ddev.lua

local parser = clink.arg.new_parser

local ddev_parser = parser(
    {
        -- ...
        "composer" .. composer_parser,
        -- ...
    },
    -- ...
)

clink.arg.register_parser("ddev", ddev_parser)

Is it possible to write a Composer parser which is reusable within ddev composer?

jfastnacht avatar Feb 01 '19 15:02 jfastnacht