Skip to content

Commit aa59254

Browse files
author
Ryan Svihla
committed
bug fixes in parsing
1 parent 6a22111 commit aa59254

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

cmd/db/create.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func CreateUsage() string {
4646

4747
// ExecuteCreate submits a new database to astra
4848
func ExecuteCreate(args []string, client *astraops.AuthenticatedClient) error {
49-
if err := createCmd.Parse(args[1:]); err != nil {
49+
if err := createCmd.Parse(args); err != nil {
5050
return &pkg.ParseError{
5151
Args: args,
5252
Err: err,

cmd/db/get.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,19 @@ func ExecuteGet(args []string, client *astraops.AuthenticatedClient) error {
4747
Err: fmt.Errorf("there is no id provided for parking the database"),
4848
}
4949
}
50-
51-
id := args[1]
50+
if err := getCmd.Parse(args[1:]); err != nil {
51+
return &pkg.ParseError{
52+
Args: args,
53+
Err: err,
54+
}
55+
}
56+
id := args[0]
5257
var db astraops.DataBase
5358
var err error
5459
if db, err = client.FindDb(id); err != nil {
5560
return fmt.Errorf("unable to get '%s' with error %v\n", id, err)
5661
}
62+
fmt.Println(*getFmt)
5763
switch *getFmt {
5864
case "text":
5965
var rows [][]string

cmd/db/park.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func ExecutePark(args []string, client *astraops.AuthenticatedClient) error {
3636
Err: fmt.Errorf("there is no id provided for parking the database"),
3737
}
3838
}
39-
id := args[1]
39+
id := args[0]
4040
fmt.Printf("starting to park database %v\n", id)
4141
if err := client.Park(id); err != nil {
4242
return fmt.Errorf("unable to park '%s' with error %v\n", id, err)

cmd/db/unpark.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func ExecuteUnpark(args []string, client *astraops.AuthenticatedClient) error {
3636
Err: fmt.Errorf("there is no id provided for unparking the database"),
3737
}
3838
}
39-
id := args[1]
39+
id := args[0]
4040
fmt.Printf("starting to unpark database %v\n", id)
4141
if err := client.UnPark(id); err != nil {
4242
return fmt.Errorf("unable to unpark '%s' with error %v\n", id, err)

0 commit comments

Comments
 (0)