-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Limit the number of versions retrieved by command generate and …
…update. Sovle issue #2355 (#2447) * feat(limit query versions):Add limit flag to generate command * feat(limit query versions):Add limit parameter to FuzzyGetter.Get * feat(limit query versions):Add limit parameter to VersionGetter.List * feat(limit query versions): Set the default limit to 30 and Reduce the consumption of GitHub API * feat(limit query versions): Add help info for --limit/-l flag in g command * feat(limit query versions): Edit "defaultVerNumLimit" to "defaultVerCntLimit" for avoiding ambiguity * feat(limit query versions): Move constants * feat(limit query versions): Remove redundant code * feat(limit query versions): Add limit flag to update command * feat(limit query versions): Add help info for --limit/-l flag in update command * feat(limit query versions): Set limit before searching versions in update command * feat(limit query versions): Make some minor changes * feat(limit query versions): Remove code that could result in version data loss * feat(limit query versions): Remove nolint:gomnd directive * feat(limit query versions): Determine the 'per_page' value depending on the existence of filter * feat(limit query versions): Use the recommended approach for pagination * feat(limit query versions): Reduce cognitive complexity * feat(limit query versions): Reduce cyclomatic complexity * feat(limit query versions): Edit mock data * feat(limit query versions): fix wrong variable * feat(limit query versions): Non-positive number of limit will refer to no limitation * feat(limit query versions): fix lint issue of magic number
- Loading branch information
Showing
22 changed files
with
87 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,8 +86,15 @@ echo "cli/cli" | aqua g -f - | |
- name: cli/[email protected] | ||
You can select a version interactively with "-s" option. | ||
By default, aqua g -s will only display 30 versions of package. | ||
Use --limit/-l to change it. Non-positive number refers to no limit. | ||
# Display 30 versions of selected by default | ||
$ aqua g -s | ||
# Display all versions of selected package | ||
$ aqua g -s -l -1 | ||
# Display 5 versions of selected package | ||
$ aqua g -s -l 5 | ||
The option "-pin" is useful to prevent the package from being updated by Renovate. | ||
|
@@ -137,7 +144,13 @@ func (r *Runner) newGenerateCommand() *cli.Command { | |
&cli.BoolFlag{ | ||
Name: "select-version", | ||
Aliases: []string{"s"}, | ||
Usage: `Select the installed version interactively`, | ||
Usage: `Select the installed version interactively. Default to display 30 versions, use --limit/-l to change it.`, | ||
}, | ||
&cli.IntFlag{ | ||
Name: "limit", | ||
Aliases: []string{"l"}, | ||
Usage: "The maximum number of versions. Non-positive number refers to no limit.", | ||
Value: config.DefaultVerCnt, | ||
}, | ||
}, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters