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

feat: add hyphen subcommand to git and cd spec #85

Merged
merged 3 commits into from
Apr 1, 2021

Conversation

cstrnt
Copy link
Contributor

@cstrnt cstrnt commented Apr 1, 2021

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
New Spec

What is the current behavior? (You can also link to an open issue here)
The - subcommand for git checkoutand cd is not implemented

What is the new behavior (if this is a feature change)?
It implements the subcommand for both specs

Additional info:

@brendanfalk
Copy link
Member

Hey Tim - so the - is an argument not a subcommand.

So for both cd and git checkout, we will need to add the following to the arg object:

args: {
    ...,
    suggestions: [{name: "-", description: "switch to the last used folder" }]
}

I believe the prop name is suggestions however it could also be additionalSuggestions. You'll have to test

Slides 5 and 6 of this hack-night deck give you a good summary of how it works: https://docs.google.com/presentation/d/1B69F5mg0YPu7z6Y6VQkNgdWgPXCg8fVVHWcgu4BYEL4/edit#slide=id.gc60f6c760e_0_15

@cstrnt
Copy link
Contributor Author

cstrnt commented Apr 1, 2021

I totally messed that one up (and it actually works this way as well). Will change that and keep the actual way in mind

@cstrnt cstrnt requested a review from brendanfalk April 1, 2021 20:38
@brendanfalk brendanfalk merged commit e0d0886 into master Apr 1, 2021
@brendanfalk
Copy link
Member

Looks good! Here is something I just wrote up about the difference between subcommands, options, and arguments. Definitely needs a look over, but high level stuff is there: https://forum.withfig.com/t/cli-tools-the-difference-between-a-command-subcommand-option-and-argument/56

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.

None yet

2 participants