Skip to content

Commit

Permalink
Switch back to the horse's mouth for the cli package.
Browse files Browse the repository at this point in the history
Fixes #93.
  • Loading branch information
jacobsa committed Jul 27, 2015
2 parents 820de48 + 130a833 commit 9c0b50a
Show file tree
Hide file tree
Showing 16 changed files with 89 additions and 71 deletions.
10 changes: 5 additions & 5 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 48 additions & 29 deletions flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,43 @@ import (
"os"
"time"

"github.com/codegangsta/cli"
mountpkg "github.com/googlecloudplatform/gcsfuse/mount"
"github.com/jgeewax/cli"
)

// Set up custom help text for gcsfuse; in particular the usage section.
func init() {
cli.AppHelpTemplate = `NAME:
{{.Name}} - {{.Usage}}
USAGE:
{{.Name}} {{if .Flags}}[global options]{{end}} bucket mountpoint
{{if .Version}}
VERSION:
{{.Version}}
{{end}}{{if len .Authors}}
AUTHOR(S):
{{range .Authors}}{{ . }}{{end}}
{{end}}{{if .Commands}}
COMMANDS:
{{range .Commands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{end}}{{end}}{{if .Flags}}
GLOBAL OPTIONS:
{{range .Flags}}{{.}}
{{end}}{{end}}{{if .Copyright }}
COPYRIGHT:
{{.Copyright}}
{{end}}
`
}

func newApp() (app *cli.App) {
app = &cli.App{
Name: "gcsfuse",
Usage: "Mount a GCS bucket locally",
ArgumentUsage: "bucket mountpoint",
HideHelp: true,
HideVersion: true,
Writer: os.Stderr,
Name: "gcsfuse",
Usage: "Mount a GCS bucket locally",
HideHelp: true,
HideVersion: true,
Writer: os.Stderr,
Flags: []cli.Flag{

cli.BoolFlag{
Expand All @@ -47,31 +72,27 @@ func newApp() (app *cli.App) {
},

cli.IntFlag{
Name: "dir-mode",
Value: 0755,
Usage: "Permissions bits for directories. (default: 0755)",
HideDefault: true,
Name: "dir-mode",
Value: 0755,
Usage: "Permissions bits for directories. (default: 0755)",
},

cli.IntFlag{
Name: "file-mode",
Value: 0644,
Usage: "Permission bits for files (default: 0644)",
HideDefault: true,
Name: "file-mode",
Value: 0644,
Usage: "Permission bits for files (default: 0644)",
},

cli.IntFlag{
Name: "uid",
Value: -1,
HideDefault: true,
Usage: "UID owner of all inodes.",
Name: "uid",
Value: -1,
Usage: "UID owner of all inodes.",
},

cli.IntFlag{
Name: "gid",
Value: -1,
HideDefault: true,
Usage: "GID owner of all inodes.",
Name: "gid",
Value: -1,
Usage: "GID owner of all inodes.",
},

cli.BoolFlag{
Expand All @@ -85,9 +106,8 @@ func newApp() (app *cli.App) {
/////////////////////////

cli.StringFlag{
Name: "key-file",
Value: "",
HideDefault: true,
Name: "key-file",
Value: "",
Usage: "Path to JSON key file for use with GCS. " +
"(default: none, Google application default credentials used)",
},
Expand Down Expand Up @@ -130,9 +150,8 @@ func newApp() (app *cli.App) {
},

cli.StringFlag{
Name: "temp-dir",
Value: "",
HideDefault: true,
Name: "temp-dir",
Value: "",
Usage: "Temporary directory for local GCS object copies. " +
"(default: system default, likely /tmp)",
},
Expand Down
2 changes: 1 addition & 1 deletion flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"testing"
"time"

"github.com/codegangsta/cli"
. "github.com/jacobsa/oglematchers"
. "github.com/jacobsa/ogletest"
"github.com/jgeewax/cli"
)

func TestFlags(t *testing.T) { RunTests(t) }
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import (
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"

"github.com/codegangsta/cli"
"github.com/jacobsa/fuse"
"github.com/jacobsa/gcloud/gcs"
"github.com/jacobsa/syncutil"
"github.com/jgeewax/cli"
)

////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion mount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import (

"golang.org/x/net/context"

"github.com/codegangsta/cli"
"github.com/jacobsa/fuse"
"github.com/jacobsa/gcloud/gcs"
"github.com/jacobsa/gcloud/gcs/gcsfake"
"github.com/jacobsa/gcloud/gcs/gcsutil"
. "github.com/jacobsa/ogletest"
"github.com/jacobsa/timeutil"
"github.com/jgeewax/cli"
)

func TestMount(t *testing.T) { RunTests(t) }
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9c0b50a

Please sign in to comment.