radian-software / pass-ln

🔑 Pass extension for creating symbolic links.
MIT License
13 stars 2 forks source link

feat: add bash completion #4

Closed rylancates closed 2 years ago

rylancates commented 2 years ago

Setup information:

I used pass-otp as a guide.

This worked for me with the following steps:

$ cp pass-ln.bash /usr/local/lib/password-store/extensions/ln.bash
$ cp pass-ln.bash.completion /etc/bash_completion.d/pass-ln

After reloading my shell:

rylan@host:~$ pass 
cp         find       git        help       insert     ls         otp        show       test/   
edit       generate   grep       init       ln         mv         rm         version    test2/  
rylan@host:~$ pass ln test
test/   test2/

Is there anything further you'd like done at this point?

rylancates commented 2 years ago

@raxod502 - I just updated with what appears to be what's necessary to get the file installed properly.

NOTE: I haven't tested the build yet, hence the draft state of the PR still.

I'll run & debug the tarball and deb installation steps at some point today.

What I'm not able to test is the homebrew ruby template as I'm not a mac user and am not familiar with any of the syntax.

Is that something you'd be able to test?

rylancates commented 2 years ago

I tested tarball & deb installation like so:

$ # first, cleaned up and uninstalled any trace of pass, pass-otp, and pass-ln
$ cd packaging
$ make tar
$ make deb
$ # this yielded an error due to the lack of a VERSION env var:
$ ./deb-install.bash
$ # so I emulated the step performed by the above script instead:
$ sudo apt reinstall "./out/2.0.1.4-g46fcb69/pass-extension-ln-2.0.1-4-g46fcb69.deb"
$ sudo systemctl reboot # on an lxc container so lazy approach to sourcing bash profile etc.
$ # see `ln` present when tabbing on `pass`
$ pass 
cp         edit       find       generate   git        grep       help       init       insert     ln         ls         mv         rm         show       version    test/   test2/
$ # see folder/item autocomplete works when tabbing on `pass ln`
$ pass ln test
test/   test2/

Success!

I've altered but haven't tested a couple other things.

I'm happy to remove those alterations (AUR, RPM, Homebrew) if you don't have the bandwidth to review/test.

raxod502 commented 2 years ago

Thank you! I will make any needed adjustments and merge in the next week or so.

raxod502 commented 2 years ago

This looks pretty good. To make future changes like this easier to test, I'm going to take a bit of time to set up some Dockerfiles that can be used to run the various distributions easily, so that installation can be tested without having to manually obtain or set up anything. Will merge after that is complete.

raxod502 commented 2 years ago

This is taking a bit longer than expected, but I continue to work on setting up an easy way to test the changes (see commits above). I will do more work next week.

rylancates commented 2 years ago

Yeah of course, thanks for the support on the feature too!