Skip to content

Splitting a large argc script across multiple files #388

@mattwynne

Description

@mattwynne

Hello, we love argc and have used it to create some monstrous scripts!

I am curious if it's possible to break apart a large script such that all the sub-commands under a given command are off in a separate file.

e.g.

instead of

bin/dev

with:

release::publish() {
#  ...
# etc.

I would have

bin/dev
bin/dev-release

and the main bin/dev script would do some magic to delegate any dev release * command to the functions/subcommands in dev-release.

I've tried fiddling with different combinations of eval "$(argc --argc-eval ..) and source but I can't quite get both working sub-commands and working --help.

Is this possible in theory, or am I fighting some implicit constraint? If it is possible, could you share a pattern/recipe?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions