github.com/apptainer/singularity@v3.1.1+incompatible/cmd/internal/cli/key.go (about) 1 // Copyright (c) 2017-2019, Sylabs Inc. All rights reserved. 2 // This software is licensed under a 3-clause BSD license. Please consult the 3 // LICENSE.md file distributed with the sources of this project regarding your 4 // rights to use or distribute this software. 5 6 package cli 7 8 import ( 9 "errors" 10 "github.com/spf13/cobra" 11 "github.com/sylabs/singularity/docs" 12 ) 13 14 const ( 15 defaultKeyServer = "https://keys.sylabs.io" 16 ) 17 18 var ( 19 keyServerURL string // -u command line option 20 ) 21 22 func init() { 23 SingularityCmd.AddCommand(KeysCmd) 24 SingularityCmd.AddCommand(KeyCmd) 25 26 // key commands 27 KeyCmd.AddCommand(KeyNewPairCmd) 28 KeyCmd.AddCommand(KeyListCmd) 29 KeyCmd.AddCommand(KeySearchCmd) 30 KeyCmd.AddCommand(KeyPullCmd) 31 KeyCmd.AddCommand(KeyPushCmd) 32 33 // keys commands 34 KeysCmd.AddCommand(KeyNewPairCmd) 35 KeysCmd.AddCommand(KeyListCmd) 36 KeysCmd.AddCommand(KeySearchCmd) 37 KeysCmd.AddCommand(KeyPullCmd) 38 KeysCmd.AddCommand(KeyPushCmd) 39 } 40 41 // KeysCmd is the 'keys' command that allows management of key stores 42 var KeysCmd = &cobra.Command{ 43 RunE: func(cmd *cobra.Command, args []string) error { 44 return errors.New("Invalid command") 45 }, 46 DisableFlagsInUseLine: true, 47 Hidden: true, 48 49 Use: docs.KeysUse, 50 Short: docs.KeyShort, 51 Long: docs.KeyLong, 52 Example: docs.KeyExample, 53 SilenceErrors: true, 54 } 55 56 // KeyCmd is the 'key' command that allows management of key stores 57 var KeyCmd = &cobra.Command{ 58 RunE: func(cmd *cobra.Command, args []string) error { 59 return errors.New("Invalid command") 60 }, 61 DisableFlagsInUseLine: true, 62 63 Use: docs.KeyUse, 64 Short: docs.KeyShort, 65 Long: docs.KeyLong, 66 Example: docs.KeyExample, 67 SilenceErrors: true, 68 }