Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add git-like subcommand deferring mechanism #6

Merged
merged 1 commit into from
Nov 12, 2021

Conversation

TeddyDD
Copy link
Contributor

@TeddyDD TeddyDD commented Nov 12, 2021

This commit implements a simple mechanism of deferring unknown
subcommands to other executables in $PATH.

When users executes kks foo kks will try to run kks-foo command.

Example:

$ cat ~/.local/bin/kks-date                                                                                                                                                                                  
#!/bin/sh
date $@
$ kks date -I
2021-11-12
$ kks grep
...

Just an idea, feel free to ignore if you don't like it (It can be implemented as wrapper script by user) :)

@kkga
Copy link
Owner

kkga commented Nov 12, 2021

I quite like the idea. Thanks!

Let me test this a bit before merging.

@kkga kkga self-requested a review November 12, 2021 15:58
Copy link
Owner

@kkga kkga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks and works great. Found a small typo in error naming...

cmd/root.go Outdated Show resolved Hide resolved
cmd/root.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
This commit implements a simple mechanism of deferring unknown
subcommands to other executables in $PATH.

When users executes `kks foo` kks will try to run `kks-foo` command.
@TeddyDD TeddyDD force-pushed the git-like-defer-subcommand branch from ac1260f to 08cd1a6 Compare November 12, 2021 19:15
@TeddyDD
Copy link
Contributor Author

TeddyDD commented Nov 12, 2021

Whoops, fixed.

@kkga kkga merged commit dcdf86b into kkga:main Nov 12, 2021
@kkga
Copy link
Owner

kkga commented Nov 12, 2021

Great, thanks again!

@TeddyDD TeddyDD deleted the git-like-defer-subcommand branch November 12, 2021 19:30
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.

2 participants