Skip to content

Commit

Permalink
cmd/all: List releases in descending order
Browse files Browse the repository at this point in the history
Closes #61
  • Loading branch information
jmooring committed Dec 23, 2023
1 parent f2fc3c1 commit 944c67b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ If you regularly exceed this limit, you can create a GitHub personal access toke

By default, the `hvm use` and `hvm install` commands display the 30 most recent releases. To display all releases since v0.54.0, set the value to `-1`. Releases before v0.54.0 were not semantically versioned.

**sortAscending** (bool, default `true`)
**sortAscending** (bool, default `false`)

By default, the `hvm use` and `hvm install` commands display the list of recent releases in ascending order. To display the list in descending order, set this value to `false`.
By default, the `hvm use` and `hvm install` commands display the list of recent releases in descending order. To display the list in ascending order, set this value to `true`.

[go]: https://go.dev/doc/install
[hugo]: https://github.com/gohugoio/hugo/#readme
Expand Down
Binary file modified assets/hvm.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions assets/hvm.tape
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Type "hvm use"
Enter
Sleep 3

Type "27"
Type "1"
Enter
Sleep 5

Expand All @@ -46,7 +46,7 @@ Type "hvm use"
Enter
Sleep 3

Type "30"
Type "7"
Enter
Sleep 5

Expand Down
2 changes: 1 addition & 1 deletion cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func initConfig() {
// Set default values.
viper.SetDefault("githubToken", "")
viper.SetDefault("numTagsToDisplay", 30)
viper.SetDefault("sortAscending", true)
viper.SetDefault("sortAscending", false)

// Create config directory.
userConfigDir, err := os.UserConfigDir()
Expand Down
2 changes: 1 addition & 1 deletion cmd/testscripts/config/config_without_file.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
exec hvm config
stdout 'githubToken = ''.*''\n'
stdout 'numTagsToDisplay = 30\n'
stdout 'sortAscending = true\n'
stdout 'sortAscending = false\n'
[darwin] stdout 'Configuration file: .+/home/Library/Application Support/hvm/config\.toml\n'
[linux] stdout 'Configuration file: .+/config/hvm/config\.toml\n'
[windows] stdout 'Configuration file: .+\\config\\hvm\\config\.toml\n'
1 change: 1 addition & 0 deletions cmd/testscripts/install.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

# Test
env HVM_NUMTAGSTODISPLAY=-1
env HVM_SORTASCENDING=true
stdin input.txt
exec hvm install
stdout 'Select a version to use when version management is disabled: '
Expand Down
1 change: 1 addition & 0 deletions cmd/testscripts/use/use.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

# Test
env HVM_NUMTAGSTODISPLAY=-1
env HVM_SORTASCENDING=true
stdin input.txt
exec hvm use
stdout 'Select a version to use in the current directory: '
Expand Down

0 comments on commit 944c67b

Please sign in to comment.