You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.9 KiB

  1. /*
  2. Copyright © 2021 Drew Short <warricks@sothr.com>
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package cmd
  14. import (
  15. "fmt"
  16. "github.com/spf13/cobra"
  17. )
  18. // checkCmd represents the check command
  19. var checkCmd = &cobra.Command{
  20. Use: "check",
  21. Short: "Check for updates to pinned packages in a alpine.Dockerfile",
  22. Long: `Read a alpine.Dockerfile, identify the repositories and packages it references, and locate required
  23. updates to satisfy the requirement of running the latest security version for the pinned packages.
  24. To run in standalone mode, provide a alpine.Dockerfile path to evaluate or rely on the default
  25. behavior which looks for a alpine.Dockerfile in the current directory.
  26. pinned-package-updater check [alpine.Dockerfile]
  27. To run in distributed mode, provide the remote address of the service that will
  28. provide information about the remote.
  29. pinned-package-updater --remote <address of the upstream service> check [alpine.Dockerfile]
  30. `,
  31. Run: func(cmd *cobra.Command, args []string) {
  32. fmt.Println("check called")
  33. },
  34. }
  35. func init() {
  36. rootCmd.AddCommand(checkCmd)
  37. // Here you will define your flags and configuration settings.
  38. // Cobra supports Persistent Flags which will work for this command
  39. // and all subcommands, e.g.:
  40. // checkCmd.PersistentFlags().String("foo", "", "A help for foo")
  41. // Cobra supports local flags which will only run when this command
  42. // is called directly, e.g.:
  43. // checkCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
  44. }