Skip to content

Commit

Permalink
Add basic command descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jero075 committed Apr 9, 2024
1 parent 53acb18 commit 77661e3
Show file tree
Hide file tree
Showing 28 changed files with 133 additions and 200 deletions.
16 changes: 4 additions & 12 deletions gt/cmd/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,16 @@ THE SOFTWARE.
package cmd

import (
"fmt"

"github.com/spf13/cobra"
)

// backupCmd represents the backup command
var backupCmd = &cobra.Command{
Use: "backup",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("backup called")
},
Short: "Back up databases",
Long: `This command is currently not supported by the GoTables server
Requires NOTHING to be set`,
// Run: func(cmd *cobra.Command, args []string) { fmt.Println("backup called") },
}

func init() {
Expand Down
10 changes: 3 additions & 7 deletions gt/cmd/column.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,9 @@ import (
// columnCmd represents the column command
var columnCmd = &cobra.Command{
Use: "column",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "Column operations",
Long: `Operations on columns
Requires db AND table to be set`,
// Run: func(cmd *cobra.Command, args []string) { fmt.Println("column called") },
}

Expand Down
12 changes: 5 additions & 7 deletions gt/cmd/columnCopy.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ import (
// columnCopyCmd represents the columnCopy command
var columnCopyCmd = &cobra.Command{
Use: "copy",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "Copy a column",
Long: `This command copies an existing column in a table
and creates a new identical column with a different name
Requires db AND table to be set
Syntax: column copy [originalName] [newName]`,
Run: func(cmd *cobra.Command, args []string) {
host := cmd.Flag("host").Value.String()
token := cmd.Flag("token").Value.String()
Expand Down
11 changes: 4 additions & 7 deletions gt/cmd/columnCreate.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@ import (
// columnCreateCmd represents the columnCreate command
var columnCreateCmd = &cobra.Command{
Use: "create",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "Create a column",
Long: `This command creates a new column in a table
Requires db AND table to be set
Syntax: column create [name]`,
Run: func(cmd *cobra.Command, args []string) {
host := cmd.Flag("host").Value.String()
token := cmd.Flag("token").Value.String()
Expand Down
11 changes: 4 additions & 7 deletions gt/cmd/columnDelete.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@ import (
// columnDeleteCmd represents the columnDelete command
var columnDeleteCmd = &cobra.Command{
Use: "delete",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "Delete a column",
Long: `This command deletes an existing column in a table
Requires db AND table to be set
Syntax: column delete [name]`,
Run: func(cmd *cobra.Command, args []string) {
host := cmd.Flag("host").Value.String()
token := cmd.Flag("token").Value.String()
Expand Down
10 changes: 3 additions & 7 deletions gt/cmd/columnSet.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,9 @@ import (
// columnSetCmd represents the columnSet command
var columnSetCmd = &cobra.Command{
Use: "set",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "Set properties of a column",
Long: `Set properties of a column
Requires db AND table to be set`,
// Run: func(cmd *cobra.Command, args []string) { fmt.Println("columnSet called") },
}

Expand Down
12 changes: 5 additions & 7 deletions gt/cmd/columnSetDefault.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ import (
// columnSetDefaultCmd represents the columnSetDefault command
var columnSetDefaultCmd = &cobra.Command{
Use: "default",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "Set default value of a column",
Long: `This command sets the default value for cells
in this column in new rows
Requires db AND table to be set
Syntax: column set default [name] [value]`,
Run: func(cmd *cobra.Command, args []string) {
host := cmd.Flag("host").Value.String()
token := cmd.Flag("token").Value.String()
Expand Down
11 changes: 4 additions & 7 deletions gt/cmd/columnSetName.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@ import (
// columnSetNameCmd represents the columnSetName command
var columnSetNameCmd = &cobra.Command{
Use: "name",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "Set name of a column",
Long: `This command sets a new name for a column
Requires db AND table to be set
Syntax: column set name [oldName] [newName]`,
Run: func(cmd *cobra.Command, args []string) {
host := cmd.Flag("host").Value.String()
token := cmd.Flag("token").Value.String()
Expand Down
12 changes: 5 additions & 7 deletions gt/cmd/columnShow.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ import (
// columnShowCmd represents the columnShow command
var columnShowCmd = &cobra.Command{
Use: "show",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "Set default value of a column",
Long: `This command displays all properties of
columns in a table
Requires db AND table to be set
Syntax: column show [name1:name2:name3 ... ]`,
Run: func(cmd *cobra.Command, args []string) {
host := cmd.Flag("host").Value.String()
token := cmd.Flag("token").Value.String()
Expand Down
14 changes: 7 additions & 7 deletions gt/cmd/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import (
// copyCmd represents the copy command
var copyCmd = &cobra.Command{
Use: "copy",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "Copy a db or table",
Long: `This command copies an entire database
or table and creates a copy with a new name
in this column in new rows
Requires db to be set OR
Requires db AND table to be set
Syntax: copy [newName]`,
Run: func(cmd *cobra.Command, args []string) {
host := cmd.Flag("host").Value.String()
token := cmd.Flag("token").Value.String()
Expand Down
12 changes: 5 additions & 7 deletions gt/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ import (
// createCmd represents the create command
var createCmd = &cobra.Command{
Use: "create",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "Create a db or table",
Long: `This command creates a new database or table
Requires db to be set OR
Requires db AND table to be set
Syntax: create`,
Run: func(cmd *cobra.Command, args []string) {
host := cmd.Flag("host").Value.String()
token := cmd.Flag("token").Value.String()
Expand Down
12 changes: 5 additions & 7 deletions gt/cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ import (
// deleteCmd represents the delete command
var deleteCmd = &cobra.Command{
Use: "delete",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "Delete a db or table",
Long: `This command deletes a database or table
Requires db to be set OR
Requires db AND table to be set
Syntax: delete [name]`,
Run: func(cmd *cobra.Command, args []string) {
host := cmd.Flag("host").Value.String()
token := cmd.Flag("token").Value.String()
Expand Down
2 changes: 1 addition & 1 deletion gt/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var (
var rootCmd = &cobra.Command{
Use: "",
Short: "gt-cli GT syntax",
Long: `GoTables-CLI tool to interact with a GoTables server (GT)`,
Long: `GoTables-CLI tool to interact with a GoTables server (GT syntax)`,
// Uncomment the following line if your bare application
// has an action associated with it:
Run: func(cmd *cobra.Command, args []string) {},
Expand Down
10 changes: 3 additions & 7 deletions gt/cmd/row.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,9 @@ import (
// rowCmd represents the row command
var rowCmd = &cobra.Command{
Use: "row",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "Row operations",
Long: `Operations on rows
Requires db AND table to be set`,
// Run: func(cmd *cobra.Command, args []string) { fmt.Println("row called") },
}

Expand Down
12 changes: 5 additions & 7 deletions gt/cmd/rowCopy.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ import (
// rowCopyCmd represents the rowCopy command
var rowCopyCmd = &cobra.Command{
Use: "copy",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "Copy a row",
Long: `This command copies an existing row in a table
and creates a new identical row
Requires db AND table to be set
Syntax: row copy [originalIndex] [newIndex]`,
Run: func(cmd *cobra.Command, args []string) {
host := cmd.Flag("host").Value.String()
token := cmd.Flag("token").Value.String()
Expand Down
13 changes: 6 additions & 7 deletions gt/cmd/rowCreate.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ import (
// rowCreateCmd represents the rowCreate command
var rowCreateCmd = &cobra.Command{
Use: "create",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "Create a row",
Long: `This command creates a new row in a table
Requires db AND table to be set
Syntax: row create
If including values for cells
Syntax: row create [columnName1:value] [columnName2:value] ...`,
Run: func(cmd *cobra.Command, args []string) {
host := cmd.Flag("host").Value.String()
token := cmd.Flag("token").Value.String()
Expand Down
11 changes: 4 additions & 7 deletions gt/cmd/rowDelete.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@ import (
// rowDeleteCmd represents the rowDelete command
var rowDeleteCmd = &cobra.Command{
Use: "delete",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "Delete a row",
Long: `This command deletes a row in a table
Requires db AND table to be set
Syntax: row delete [index]`,
Run: func(cmd *cobra.Command, args []string) {
host := cmd.Flag("host").Value.String()
token := cmd.Flag("token").Value.String()
Expand Down
11 changes: 4 additions & 7 deletions gt/cmd/rowSet.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@ import (
// rowSetCmd represents the rowSet command
var rowSetCmd = &cobra.Command{
Use: "set",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "Set value of cell",
Long: `This command sets the value of a cell in a row in a table
Requires db AND table to be set
Syntax: row set [rowIndex:columnName] [value]`,
Run: func(cmd *cobra.Command, args []string) {
host := cmd.Flag("host").Value.String()
token := cmd.Flag("token").Value.String()
Expand Down
11 changes: 4 additions & 7 deletions gt/cmd/rowShow.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@ import (
// rowShowCmd represents the rowShow command
var rowShowCmd = &cobra.Command{
Use: "show",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "Display rows",
Long: `This command displays rows in a table
Requires db AND table to be set
Syntax: row show [index1:index2:index3 ... ]`,
Run: func(cmd *cobra.Command, args []string) {
host := cmd.Flag("host").Value.String()
token := cmd.Flag("token").Value.String()
Expand Down
13 changes: 6 additions & 7 deletions gt/cmd/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ import (
// setCmd represents the set command
var setCmd = &cobra.Command{
Use: "set",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "Set db or table or change name",
Long: `Set the name of the database or table to interact with
or change the name of a database or table
Requires NOTHING to be set OR
Requires db to be set OR
Requires db AND table to be set`,
// Run: func(cmd *cobra.Command, args []string) { fmt.Println("set called") },
}

Expand Down
11 changes: 4 additions & 7 deletions gt/cmd/setDb.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,10 @@ import (
// dbCmd represents the db command
var dbCmd = &cobra.Command{
Use: "db",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "Set db",
Long: `Set the name of the database to interact with
Requires NOTHING to be set
Syntax: set db [name]`,
Run: func(cmd *cobra.Command, args []string) {
shared.Location = "/" + args[0]
},
Expand Down
Loading

0 comments on commit 77661e3

Please sign in to comment.