Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Side by Side Diff: go/src/infra/tools/cr/cmd/root.go

Issue 1905233002: Add framework for basic cr command (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « go/src/infra/tools/cr/cmd/firstrun.go ('k') | go/src/infra/tools/cr/main.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /*
6 Root command of the SDK; does most of the heavy lifting.
7 */
8
9 package cmd
10
11 import (
12 "fmt"
13 "os"
14
15 "github.com/spf13/cobra"
16 )
17
18 // RootCmd is the root of the command tree. All subcommands attach to this one.
19 // Also defines some persistent flags which are available to all subcommands.
20 // Does not have a top-level Run function; instead just prints Usage.
21 var RootCmd = &cobra.Command{
22 Use: "cr",
23 Short: "Entry point and module manager for the Chromium command-line SDK ",
24 Long: `Entry point and module manager for the Chromium command-line SDK.
25
26 Run "cr help", "cr help [command]", or "cr [command] --help" for documentation.` ,
27 }
28
29 // Execute crawls the tree of commands (starting at RootCmd) to find the
30 // appropriate function to execute. Prints usage is none is found.
31 func Execute() {
32 if err := RootCmd.Execute(); err != nil {
33 fmt.Println(err)
34 os.Exit(-1)
35 }
36 }
37
38 func init() {
39 RootCmd.PersistentFlags().BoolP("verbose", "v", false, "Turn on verbose logging")
40 }
OLDNEW
« no previous file with comments | « go/src/infra/tools/cr/cmd/firstrun.go ('k') | go/src/infra/tools/cr/main.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698