mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
changes in the fn organization and aliases (#475)
This commit is contained in:
@@ -21,7 +21,7 @@ func apps() cli.Command {
|
||||
|
||||
return cli.Command{
|
||||
Name: "apps",
|
||||
Usage: "operate applications",
|
||||
Usage: "manage applications",
|
||||
ArgsUsage: "fn apps",
|
||||
Subcommands: []cli.Command{
|
||||
{
|
||||
|
||||
27
fn/images.go
Normal file
27
fn/images.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/iron-io/functions_go"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
type imagesCmd struct {
|
||||
*functions.AppsApi
|
||||
}
|
||||
|
||||
func images() cli.Command {
|
||||
return cli.Command{
|
||||
Name: "images",
|
||||
Usage: "manage function images",
|
||||
ArgsUsage: "fn images",
|
||||
Subcommands: []cli.Command{
|
||||
build(),
|
||||
deploy(),
|
||||
bump(),
|
||||
call(),
|
||||
push(),
|
||||
run(),
|
||||
testfn(),
|
||||
},
|
||||
}
|
||||
}
|
||||
63
fn/main.go
63
fn/main.go
@@ -9,33 +9,68 @@ import (
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
const fnversion = "0.1.39"
|
||||
const fnversion = "0.1.40"
|
||||
|
||||
var aliases = map[string]cli.Command{
|
||||
"build": build(),
|
||||
"bump": bump(),
|
||||
"deploy": deploy(),
|
||||
}
|
||||
|
||||
func aliasesFn() []cli.Command {
|
||||
cmds := []cli.Command{}
|
||||
for alias, cmd := range aliases {
|
||||
cmd.Name = alias
|
||||
cmd.Hidden = true
|
||||
cmds = append(cmds, cmd)
|
||||
}
|
||||
return cmds
|
||||
}
|
||||
|
||||
func main() {
|
||||
app := cli.NewApp()
|
||||
app.Name = "fn"
|
||||
app.Version = fnversion
|
||||
app.Authors = []cli.Author{{Name: "iron.io"}}
|
||||
app.Usage = "IronFunctions command line tools"
|
||||
app.UsageText = `Check the manual at https://github.com/iron-io/functions/blob/master/fn/README.md
|
||||
app.Description = "IronFunctions command line tools"
|
||||
app.UsageText = `Check the manual at https://github.com/iron-io/functions/blob/master/fn/README.md`
|
||||
|
||||
cli.AppHelpTemplate = `{{.Name}} {{.Version}}{{if .Description}}
|
||||
|
||||
{{.Description}}{{end}}
|
||||
|
||||
USAGE:
|
||||
{{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}} {{if .VisibleFlags}}[global options]{{end}}{{if .Commands}} command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}
|
||||
|
||||
ENVIRONMENT VARIABLES:
|
||||
API_URL - IronFunctions remote API address`
|
||||
app.CommandNotFound = func(c *cli.Context, cmd string) { fmt.Fprintf(os.Stderr, "command not found: %v\n", cmd) }
|
||||
API_URL - IronFunctions remote API address{{if .VisibleCommands}}
|
||||
|
||||
COMMANDS:{{range .VisibleCategories}}{{if .Name}}
|
||||
{{.Name}}:{{end}}{{range .VisibleCommands}}
|
||||
{{join .Names ", "}}{{"\t"}}{{.Usage}}{{end}}{{end}}{{end}}{{if .VisibleFlags}}
|
||||
|
||||
ALIASES:
|
||||
build (images build)
|
||||
bump (images bump)
|
||||
deploy (images deploy)
|
||||
|
||||
GLOBAL OPTIONS:
|
||||
{{range $index, $option := .VisibleFlags}}{{if $index}}
|
||||
{{end}}{{$option}}{{end}}{{end}}
|
||||
`
|
||||
|
||||
app.CommandNotFound = func(c *cli.Context, cmd string) {
|
||||
fmt.Fprintf(os.Stderr, "command not found: %v\n", cmd)
|
||||
}
|
||||
app.Commands = []cli.Command{
|
||||
apps(),
|
||||
build(),
|
||||
bump(),
|
||||
call(),
|
||||
deploy(),
|
||||
initFn(),
|
||||
lambda(),
|
||||
push(),
|
||||
apps(),
|
||||
routes(),
|
||||
run(),
|
||||
testfn(),
|
||||
images(),
|
||||
lambda(),
|
||||
version(),
|
||||
}
|
||||
app.Commands = append(app.Commands, aliasesFn()...)
|
||||
app.Run(os.Args)
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ func routes() cli.Command {
|
||||
|
||||
return cli.Command{
|
||||
Name: "routes",
|
||||
Usage: "operate routes",
|
||||
Usage: "manage routes",
|
||||
ArgsUsage: "fn routes",
|
||||
Subcommands: []cli.Command{
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user