nsomar / Guaka

The smartest and most beautiful (POSIX compliant) Command line framework for Swift 🤖

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add root command fallback to a subcommand

trispo opened this issue · comments

We need the possibility to let the root command execute a subcommand. In our use case the root command does nothing. So it would be nice that if no subcommand is specified, a default subcommand is used.

Example:
We have a root command called rootCommand with the sub commands foo and bar. foo should be the default.

We want to call:

> rootCommand "Hello World"

instead of:

> rootCommand foo "Hello World"