|
| 1 | +// This file is part of libraries-repository-engine. |
| 2 | +// |
| 3 | +// Copyright 2025 ARDUINO SA (http://www.arduino.cc/) |
| 4 | +// |
| 5 | +// This program is free software: you can redistribute it and/or modify |
| 6 | +// it under the terms of the GNU Affero General Public License as published |
| 7 | +// by the Free Software Foundation, either version 3 of the License, or |
| 8 | +// (at your option) any later version. |
| 9 | +// |
| 10 | +// This program is distributed in the hope that it will be useful, |
| 11 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | +// GNU Affero General Public License for more details. |
| 14 | +// |
| 15 | +// You should have received a copy of the GNU Affero General Public License |
| 16 | +// along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 17 | +// |
| 18 | +// You can be released from the requirements of the above licenses by purchasing |
| 19 | +// a commercial license. Buying such a license is mandatory if you want to |
| 20 | +// modify or otherwise use the software for commercial activities involving the |
| 21 | +// Arduino software without disclosing the source code of your own applications. |
| 22 | +// To purchase a commercial license, send an email to [email protected]. |
| 23 | + |
| 24 | +package cli |
| 25 | + |
| 26 | +import ( |
| 27 | + checkregistry "github.com/arduino/libraries-repository-engine/internal/cli/check-registry" |
| 28 | + "github.com/spf13/cobra" |
| 29 | +) |
| 30 | + |
| 31 | +func init() { |
| 32 | + // checkRegistryCmd defines the `check-registry` CLI subcommand. |
| 33 | + var checkRegistryCmd = &cobra.Command{ |
| 34 | + Short: "Check the registry.txt file format", |
| 35 | + Long: "Check the registry.txt file format", |
| 36 | + DisableFlagsInUseLine: true, |
| 37 | + Use: `check-registry FLAG... /path/to/registry.txt |
| 38 | +
|
| 39 | +Validate the registry.txt format and correctness.`, |
| 40 | + Args: cobra.ExactArgs(1), |
| 41 | + Run: func(cmd *cobra.Command, args []string) { |
| 42 | + checkregistry.CheckRegistry(args[0]) |
| 43 | + }, |
| 44 | + } |
| 45 | + rootCmd.AddCommand(checkRegistryCmd) |
| 46 | +} |
0 commit comments