summaryrefslogtreecommitdiffstats
path: root/cmd-projects.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd-projects.go')
-rw-r--r--cmd-projects.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/cmd-projects.go b/cmd-projects.go
index fc4bc22..8c12cbf 100644
--- a/cmd-projects.go
+++ b/cmd-projects.go
@@ -51,6 +51,10 @@ func initCmdProjects(cmdDef *[]cli.Command) {
Name: "server-path, sp",
Usage: "project server path (only used with pathmap type)",
},
+ cli.BoolFlag{
+ Name: "short, s",
+ Usage: "short output, only print create project id (useful from scripting)",
+ },
cli.StringFlag{
Name: "type, t",
Usage: "project type (pathmap|pm, cloudsync|sc)",
@@ -201,7 +205,11 @@ func projectsAdd(ctx *cli.Context) error {
return cli.NewExitError(err, 1)
}
- fmt.Printf("New project '%s' (id %v) successfully created.\n", newPrj.Label, newPrj.ID)
+ if ctx.Bool("short") {
+ fmt.Println(newPrj.ID)
+ } else {
+ fmt.Printf("New project '%s' (id %v) successfully created.\n", newPrj.Label, newPrj.ID)
+ }
return nil
}