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

Install without using Flags #120

Open
skyzyx opened this issue Mar 31, 2020 · 5 comments
Open

Install without using Flags #120

skyzyx opened this issue Mar 31, 2020 · 5 comments

Comments

@skyzyx
Copy link

skyzyx commented Mar 31, 2020

I would prefer to use a completely different approach to exposing the install/uninstall than with the flags package. I'm using a completely different package for building CLI apps, and would like to integrate the output of this framework with that other package by simply Printing/Sprinting the output to wherever the user wants.

@posener
Copy link
Owner

posener commented Mar 31, 2020

Hi!

Do you mean the COMP_INSTALL and COMP_UNINSTALL environment variables?

The Install/Uninstall functions can also be called manually. Look at this file: https://github.com/posener/complete/blob/master/install/install.go

Does this help or I totally missed your request?

@skyzyx
Copy link
Author

skyzyx commented Mar 31, 2020

Do you mean the COMP_INSTALL and COMP_UNINSTALL environment variables?

I must've missed where these were documented. Is this an end-user solution?

The Install/Uninstall functions can also be called manually. Look at this file: https://github.com/posener/complete/blob/master/install/install.go

I'll take a look. Thank you.

I'm also realizing that I was using v1, but this functionality appears to be in v2. But when I try to include v2, I'm getting errors. Ideas?

.PHONY: build
build:
	mkdir -p ./bin
	cd ./src/ && go mod tidy
	go get -v ./src/...
	go build -ldflags="-s -w" -o bin/mkit src/*.go
mkdir -p ./bin
cd ./src/ && go mod tidy
go: finding module for package github.com/posener/complete/v2
go: downloading github.com/posener/complete v1.2.3
go: found github.com/posener/complete/v2 in github.com/posener/complete/v2 v2.0.1-alpha.12
go get -v ./src/...
github.com/posener/complete (download)
package github.com/posener/complete/v2: cannot find package "github.com/posener/complete/v2" in any of:
	/usr/local/go/src/github.com/posener/complete/v2 (from $GOROOT)
	/go/src/github.com/posener/complete/v2 (from $GOPATH)
make: *** [Makefile:42: build] Error 1

My go.mod file references github.com/posener/complete/v2 v2.0.1-alpha.12.

@skyzyx
Copy link
Author

skyzyx commented Mar 31, 2020

Also, my request is more to expose bash.cmd() (and the others) as bash.Cmd() so that I can access it directly and get its contents. I don't keep this stuff in my own ~/.bash_profile, and I would like to have more control over how the autocompletion script gets loaded.

posener added a commit that referenced this issue Apr 4, 2020
@posener
Copy link
Owner

posener commented Apr 4, 2020

I must've missed where these were documented. Is this an end-user solution?

Right, I missed documenting them, added. Yes, this is an end-user solution.

I'm also realizing that I was using v1, but this functionality appears to be in v2. But when I try to include v2

Yes, you should use v2, it is written in the documentation of v1.

I'm getting errors. Ideas?

It is hard to help you. It would be easier if you could reference repo, or drop here files that you use for your project. It should be possible to use v2 when you import github.com/posener/complete/v2.

Also, my request is more to expose bash.cmd() (and the others) as bash.Cmd() so that I can access it directly and get its contents. I don't keep this stuff in my own ~/.bash_profile, and I would like to have more control over how the autocompletion script gets loaded.

Can you be more concrete about the API change that you want? Do you want to be able to provide a custom file? Or just the line that is needed to be added to the profile script?

@skyzyx
Copy link
Author

skyzyx commented Jun 11, 2020

Can you be more concrete about the API change that you want? Do you want to be able to provide a custom file? Or just the line that is needed to be added to the profile script?

Just the line that is needed to be added to the profile script.

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

No branches or pull requests

2 participants