Skip to content

Commit

Permalink
Simplify the command's description
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Wang <[email protected]>
  • Loading branch information
ahrtr committed Apr 17, 2024
1 parent cc22218 commit b174443
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cmd/bbolt/command_inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

func newInspectCobraCommand() *cobra.Command {
inspectCmd := &cobra.Command{
Use: "inspect",
Use: "inspect <bbolt-file>",
Short: "inspect the structure of the database",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/bbolt/command_root.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func NewRootCommand() *cobra.Command {

rootCmd.AddCommand(
newVersionCobraCommand(),
newSurgeryCobraCommand(),
newSurgeryCommand(),
newInspectCobraCommand(),
)

Expand Down
10 changes: 5 additions & 5 deletions cmd/bbolt/command_surgery.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var (
ErrSurgeryFreelistAlreadyExist = errors.New("the file already has freelist, please consider to abandon the freelist to forcibly rebuild it")
)

func newSurgeryCobraCommand() *cobra.Command {
func newSurgeryCommand() *cobra.Command {
surgeryCmd := &cobra.Command{
Use: "surgery <subcommand>",
Short: "surgery related commands",
Expand Down Expand Up @@ -52,7 +52,7 @@ func (o *surgeryBaseOptions) Validate() error {
func newSurgeryRevertMetaPageCommand() *cobra.Command {
var o surgeryBaseOptions
revertMetaPageCmd := &cobra.Command{
Use: "revert-meta-page <bbolt-file> [options]",
Use: "revert-meta-page <bbolt-file>",
Short: "Revert the meta page to revert the changes performed by the latest transaction",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down Expand Up @@ -111,7 +111,7 @@ func (o *surgeryCopyPageOptions) Validate() error {
func newSurgeryCopyPageCommand() *cobra.Command {
var o surgeryCopyPageOptions
copyPageCmd := &cobra.Command{
Use: "copy-page <bbolt-file> [options]",
Use: "copy-page <bbolt-file>",
Short: "Copy page from the source page Id to the destination page Id",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down Expand Up @@ -175,7 +175,7 @@ func (o *surgeryClearPageOptions) Validate() error {
func newSurgeryClearPageCommand() *cobra.Command {
var o surgeryClearPageOptions
clearPageCmd := &cobra.Command{
Use: "clear-page <bbolt-file> [options]",
Use: "clear-page <bbolt-file>",
Short: "Clears all elements from the given page, which can be a branch or leaf page",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down Expand Up @@ -242,7 +242,7 @@ func (o *surgeryClearPageElementsOptions) Validate() error {
func newSurgeryClearPageElementsCommand() *cobra.Command {
var o surgeryClearPageElementsOptions
clearElementCmd := &cobra.Command{
Use: "clear-page-elements <bbolt-file> [options]",
Use: "clear-page-elements <bbolt-file>",
Short: "Clears elements from the given page, which can be a branch or leaf page",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
4 changes: 2 additions & 2 deletions cmd/bbolt/command_surgery_freelist.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func newSurgeryFreelistCommand() *cobra.Command {
func newSurgeryFreelistAbandonCommand() *cobra.Command {
var o surgeryBaseOptions
abandonFreelistCmd := &cobra.Command{
Use: "abandon <bbolt-file> [options]",
Use: "abandon <bbolt-file>",
Short: "Abandon the freelist from both meta pages",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down Expand Up @@ -61,7 +61,7 @@ func surgeryFreelistAbandonFunc(srcDBPath string, cfg surgeryBaseOptions) error
func newSurgeryFreelistRebuildCommand() *cobra.Command {
var o surgeryBaseOptions
rebuildFreelistCmd := &cobra.Command{
Use: "rebuild <bbolt-file> [options]",
Use: "rebuild <bbolt-file>",
Short: "Rebuild the freelist",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
4 changes: 2 additions & 2 deletions cmd/bbolt/command_surgery_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func newSurgeryMetaCommand() *cobra.Command {

func newSurgeryMetaValidateCommand() *cobra.Command {
metaValidateCmd := &cobra.Command{
Use: "validate <bbolt-file> [options]",
Use: "validate <bbolt-file>",
Short: "Validate both meta pages",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down Expand Up @@ -120,7 +120,7 @@ func (o *surgeryMetaUpdateOptions) Validate() error {
func newSurgeryMetaUpdateCommand() *cobra.Command {
var o surgeryMetaUpdateOptions
metaUpdateCmd := &cobra.Command{
Use: "update <bbolt-file> [options]",
Use: "update <bbolt-file>",
Short: "Update fields in meta pages",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down

0 comments on commit b174443

Please sign in to comment.