Skip to content

Commit

Permalink
feat(install): Add short option to 'install --list' (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
raimon49 authored and kylef committed Jul 18, 2018
1 parent a479969 commit 3ffa98f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libexec/swiftenv-install
Expand Up @@ -230,7 +230,7 @@ for args in "$@"; do
clean=false
elif [ "$args" = "--clean" ]; then
clean=true
elif [ "$args" = "--list" ]; then
elif [ "$args" = "--list" ] || [ "$args" = "-l" ]; then
list=true
elif [ "$args" = "--list-snapshots" ]; then
list=true
Expand Down
2 changes: 1 addition & 1 deletion share/man/man1/swiftenv-install.1
Expand Up @@ -18,7 +18,7 @@ Installs a version of Swift.
Shows additional debugging information.
.RE

\-\-list
\-l/\-\-list

.RS
Lists all the Swift releases that can be installed.
Expand Down
9 changes: 9 additions & 0 deletions test/install.bats
Expand Up @@ -37,6 +37,15 @@ load helpers
[ "${lines[3]}" = "3.0-dev" ]
}

@test "invoking with the -l option as a short option of install --list" {
run swiftenv install -l
[ "$status" -eq 0 ]
[ "${lines[0]}" = "2.2-dev" ]
[ "${lines[1]}" = "2.2" ]
[ "${lines[2]}" = "2.2.1" ]
[ "${lines[3]}" = "3.0-dev" ]
}

@test "invoking with an installed version with skip existing saves global version" {
mkdir -p "$SWIFTENV_ROOT/versions/1.0.0"
run swiftenv install -s 1.0.0
Expand Down

0 comments on commit 3ffa98f

Please sign in to comment.