Skip to content

Commit

Permalink
improved the code and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ibilalkayy committed Apr 14, 2024
1 parent a2d6e36 commit bcf3198
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/spf13/cobra"
)

const version = "v0.1.73"
const version = "v0.1.74"

// rootCmd represents the base command when called without any subcommands
var RootCmd = &cobra.Command{
Expand Down
2 changes: 0 additions & 2 deletions db/budget_db/budget_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,12 @@ func AddExpenditure(spent int, category string) error {
if err != nil {
return err
}
fmt.Println("Enjoy your spending!")
} else if savedRemaining != 0 && (spent <= savedRemaining || spent > savedRemaining) {
query := "UPDATE Budget SET spent=$1, remaining=$2 WHERE categories=$3"
_, err = db.Exec(query, totalSpent, savedRemaining-spent, category)
if err != nil {
return err
}
fmt.Println("Enjoy your spending!")
}
return nil
}
Expand Down
22 changes: 19 additions & 3 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,15 @@ Sure, let's break down each command along with its structure for better understa
- `-h, --help`: help for total-amount
- `-i, --inactive string`: Make the total amount inactive

### 16. `flow total-amount set`
### 16. `flow total-amount active`
- **Description**: Make the total amount active.
- **Usage**: `flow total-amount active [flags]`

### 17. `flow total-amount inactive`
- **Description**: Make the total amount inactive.
- **Usage**: `flow total-amount inactive [flags]`

### 18. `flow total-amount set`
- **Description**: Set the total amount data.
- **Usage**: `flow total-amount set [flags]`
- **Flags**:
Expand All @@ -170,10 +178,18 @@ Sure, let's break down each command along with its structure for better understa
- `-l, --label string`: Provide a label for setting up your total amount
- `-h, --help`: help for set

### 17. `flow total-amount update`
### 19. `flow total-amount update`
- **Description**: Update the total amount data.
- **Usage**: `flow total-amount update [flags]`
- **Flags**:
- `-a, --amount string`: Write the total amount that you want to update
- `-l, --label string`: Write the label that you want to update
- `-h, --help`: help for set
- `-h, --help`: help for set

### 20. `flow total-amount remove`
- **Description**: Remove the total amount data.
- **Usage**: `flow total-amount remove [flags]`

### 21. `flow total-amount view`
- **Description**: View the total amount data.
- **Usage**: `flow total-amount view [flags]`

0 comments on commit bcf3198

Please sign in to comment.