Skip to content

Commit

Permalink
Local aliasing of subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
keithy committed Sep 28, 2019
1 parent 4c435eb commit cf7a399
Show file tree
Hide file tree
Showing 28 changed files with 61 additions and 725 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ To use `groan`, you rename the command to be the name of your choice.

## Commands with sub-commands and sub-sub-commands...

Roll your own gitlike command suites, complete with help-documentation help-topics and auto-completion.
Roll your own gitlike command suites, complete with help-documentation help-topics.
Support for standard options like --debug, --quiet is also included.

## Clever Stuff

Groan is recursively merge-able/compose-able. Assemble a named suite of sub-command scripts in a folder,
that folder may be made available alongside commands of another suite or nested as sub-commands within another suite.
that folder may be made available alongside, or nested as sub-commands within another suite.

Groan uses/demonstrates this internally to implement the help sub-command.
The `groan help` sub-command of `groan` is implemented by the nested command `helper`.
Expand Down
2 changes: 1 addition & 1 deletion code/sub-commands/_dispatch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function parseScriptPath()

scriptSubcommand="${scriptRoute%%.sub.*}" # everything before the first .sub
destCommand="${scriptRoute#*sub.}" # keep everything after first .sub.
destPath="${scriptDir%/*}/${destCommand}/${destCommand}"
destPath="${scriptDir%/*}/${destCommand}/${destCommand:-$commandName}"
destSubcommandName="${scriptName#*.cmd.}" # keep everything after .cmd.

fi
Expand Down
82 changes: 0 additions & 82 deletions groan-retired-commands/help-retired-commands/commands.topic.sh

This file was deleted.

69 changes: 0 additions & 69 deletions groan-retired-commands/help-retired-commands/dispatch.topics.sh

This file was deleted.

19 changes: 0 additions & 19 deletions groan-retired-commands/help-retired-commands/help.cmd.sh

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

46 changes: 0 additions & 46 deletions groan-retired-commands/help-retired-commands/topics.cmd.sh

This file was deleted.

32 changes: 0 additions & 32 deletions groan-retired-commands/help-retired-commands/usage.cmd.sh

This file was deleted.

Loading

0 comments on commit cf7a399

Please sign in to comment.