File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,13 @@ up is a tiny shell function which lets you jump to a parent directory by its nam
1111
1212* :zap : Lightning fast
1313* :keyboard : Bash completion for parent directory names
14- * :shell : Works with Bash and zsh
14+ * :shell : Works with Bash and Zsh
1515
1616## :gear : Installation
1717
18- ### git & Bash
18+ ### : shell : Git & Bash
1919
20- Clone ` up ` 's git repository.
20+ Clone ` up ` 's Git repository.
2121
2222``` sh
2323git clone https://github.com/helpermethod/up ~ /.up
@@ -35,9 +35,9 @@ Add the following line to your `.bashrc` (Linux) or `.bash_profile` (macOS) to e
3535. " $HOME /.up/completion/bash/up"
3636```
3737
38- ### git & zsh
38+ ### : shell : Git & Zsh
3939
40- Clone ` up ` 's git repository.
40+ Clone ` up ` 's Git repository.
4141
4242``` sh
4343git clone https://github.com/helpermethod/up ~ /.up
Original file line number Diff line number Diff line change @@ -25,6 +25,17 @@ assert_contains() {
2525 assert_contains main " ${COMPREPLY[@]} "
2626}
2727
28+ @test ' _up should not autocomplete the current directory name when given no arguments' {
29+ mkdir -p " ${BATS_TEST_TMPDIR} " /src/main/java
30+ cd " ${BATS_TEST_TMPDIR} " /src/main/java
31+
32+ COMP_WORDS=(up)
33+ COMP_CWORD=1
34+ _up
35+
36+ ! assert_contains java " ${COMPREPLY[@]} "
37+ }
38+
2839@test ' _up should autocomplete the parent directory name' {
2940 mkdir -p " ${BATS_TEST_TMPDIR} " /src/main/java
3041 cd " ${BATS_TEST_TMPDIR} " /src/main/java
You can’t perform that action at this time.
0 commit comments