Skip to content

Commit f01435e

Browse files
committed
Adding the foundational libraries and starter files
1 parent 86ced47 commit f01435e

File tree

6 files changed

+843
-0
lines changed

6 files changed

+843
-0
lines changed

commands/author.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright © 2015 Steve Francia <[email protected]>.
2+
//
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+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
16+
package commands
17+
18+
import (
19+
"fmt"
20+
21+
"github.com/spf13/cobra"
22+
)
23+
24+
// Defining the author command.
25+
// This will be called as 'laybrinth author'
26+
// It uses a variable set in the labyrinth.go file
27+
var authorCmd = &cobra.Command{
28+
Use: "author",
29+
Short: "Print the creator of this laybrinth",
30+
Run: func(cmd *cobra.Command, args []string) {
31+
fmt.Println(AuthorName)
32+
},
33+
}
34+
35+
func init() {
36+
RootCmd.AddCommand(authorCmd)
37+
}

0 commit comments

Comments
 (0)