Skip to content

Add subcommands. Switch from-* and to-* to them - #1708

Merged
sophiajt merged 1 commit into
nushell:masterfrom
sophiajt:subcommands
May 4, 2020
Merged

sophiajt merged 1 commit into
nushell:masterfrom
sophiajt:subcommands

Conversation

@sophiajt

@sophiajt sophiajt commented May 4, 2020

Copy link
Copy Markdown
Contributor

This PR extends the internal commands to now also contain subcommands. These subcommands are registered like normal commands, using a space between the command name and the subcommand name.

I've gone ahead and converted the from-* and to-* commands to subcommands.

As written, this also allows you to registered subcommands on existing commands, including external commands. Whether we want this behavior in the future is something we should explore.

The help system was updated to be able to list subcommands where appropriate (ex to -h).

@gitpod-io

gitpod-io Bot commented May 4, 2020

Copy link
Copy Markdown

@sophiajt
sophiajt merged commit a996804 into nushell:master May 4, 2020
@sophiajt
sophiajt deleted the subcommands branch May 4, 2020 08:44
jzaefferer added a commit to jzaefferer/nushell that referenced this pull request May 4, 2020
Both to and from without a subcommand only print the helptext. Expand the usage line a bit, so a glance at `help commands` indicates the existance of the subcommands and mentions some common formats.

Ref a996804
Ref nushell#1708
sophiajt pushed a commit that referenced this pull request May 4, 2020
Both to and from without a subcommand only print the helptext. Expand the usage line a bit, so a glance at `help commands` indicates the existance of the subcommands and mentions some common formats.

Ref a996804
Ref #1708
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant