diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2022-06-15 20:28:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-15 20:28:03 +0800 |
commit | 9f87b60b46b2d3c6c4518d772a0fdc935d454ae0 (patch) | |
tree | 6494f3904c6b9275d3e14e14e2d1f5cdc1a5ad67 /cmd | |
parent | 97548d2722201fba061d20d3119fe6ae50b834cc (diff) | |
download | gitea-9f87b60b46b2d3c6c4518d772a0fdc935d454ae0.tar.gz gitea-9f87b60b46b2d3c6c4518d772a0fdc935d454ae0.zip |
Fix cli command restore-repo: "units" should be parsed as StringSlice (#19953)
* Fix cli command restore-repo: "units" should be parsed as StringSlice because after #15790 it's read by c.StringSlice("units"). Before, the "units" were processed by strings.Split
* Add checking for invalid unit names
Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/restore_repo.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/restore_repo.go b/cmd/restore_repo.go index f0b01e7984..c3081279df 100644 --- a/cmd/restore_repo.go +++ b/cmd/restore_repo.go @@ -37,10 +37,10 @@ var CmdRestoreRepository = cli.Command{ Value: "", Usage: "Restore destination repository name", }, - cli.StringFlag{ + cli.StringSliceFlag{ Name: "units", - Value: "", - Usage: `Which items will be restored, one or more units should be separated as comma. + Value: nil, + Usage: `Which items will be restored, one or more units should be repeated with this flag. wiki, issues, labels, releases, release_assets, milestones, pull_requests, comments are allowed. Empty means all units.`, }, cli.BoolFlag{ |