This repository has been archived by the owner on Nov 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/cue/cmd: add get to define CUE package from Go
Update #24 Change-Id: Ief47b7295249354d5eafbe0bcf33ea26dd6dfdc7 Reviewed-on: https://cue-review.googlesource.com/c/cue/+/1723 Reviewed-by: Marcel van Lohuizen <[email protected]>
- Loading branch information
Showing
16 changed files
with
1,608 additions
and
10 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
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2018 The CUE Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
// getCmd represents the extract command | ||
var getCmd = &cobra.Command{ | ||
Use: "get <language> [packages]", | ||
Short: "add dependencies to the current module", | ||
Long: `Get downloads packages or modules for CUE or another language | ||
to include them in the module's pkg directory. | ||
Get requires an additional language field to determine for which | ||
language definitions should be fetched. If get fetches definitions | ||
for a language other than CUE, the definitions are extracted from | ||
the source of the respective language and stored. | ||
The specifics on how dependencies are fechted and converted vary | ||
per language and are documented in the respective subcommands. | ||
`, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
fmt.Println("get must be run as one of its subcommands") | ||
return nil | ||
}, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(getCmd) | ||
} |
Oops, something went wrong.