Exemplo n.º 1
0
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package main

import (
	"opts"
	"os"
)

var progName = "gomake"

var showVersion = opts.LongFlag("version", "display version information")
var outputFilename = opts.Single("o", "", "file to write makefile to", "Makefile")

func main() {
	// parse and handle options
	opts.Parse()
	if *showVersion {
		ShowVersion()
		os.Exit(0)
	}
}
Exemplo n.º 2
0
package main

import (
	"log"
	"opts"
	"path"
	"time"

	compile "./src/compile"
	config "./src/config"
	. "./src/data"
	input "./src/input"
	serve "./src/serve"
)

var port = opts.Single("p", "port", "the port to use", "8080")
var blogroot = opts.Single("r",
	"blogroot",
	"the root directory for blog data",
	"/usr/share/obsidian")
var showVersion = opts.Flag("", "version", "show version information")
var verbose = opts.Flag("v", "verbose", "give verbose output")

var startTime = time.Nanoseconds()

var (
	confFile    string
	templateDir string
	postDir     string
	pageDir     string
	dataDir     string
Exemplo n.º 3
0
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package main

import (
	"fmt"
	"opts"
	"os"
)

var progName = "gorules"

var showVersion = opts.LongFlag("version", "display version information")
var mainExecName = opts.Single("x", "execname",
	"name to use for executable made from 'main.go'", "main")

func main() {
	// parse and handle options
	opts.Parse()
	if *showVersion {
		ShowVersion()
		os.Exit(0)
	}
	PrintAutoNotice()
	fmt.Print(
		`
.go.${O}:
        ${GC} $*.go

.go.a: