Skip to content

Commit

Permalink
Add changelog and update error text
Browse files Browse the repository at this point in the history
  • Loading branch information
leaanthony committed May 9, 2024
1 parent ba29cdb commit 274b4ac
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

- `Added` for new features.
- `Changed` for changes in existing functionality.
- `Deprecated` for soon-to-be removed features.
- `Removed` for now removed features.
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.

## [Unreleased]

### Added
- Added support for slice flags. Added by @zkep in [PR](https://github.com/leaanthony/clir/pull/23)

### Fixed

### Changed
16 changes: 8 additions & 8 deletions command.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ func (c *Command) AddFlags(optionStruct interface{}) *Command {
// set value of field to default value
value, err := strconv.Atoi(defaultValue)
if err != nil {
panic("Invalid default value for int flag")
panic("Invalid default value for int64 flag")
}
field.SetInt(int64(value))
}
Expand All @@ -361,7 +361,7 @@ func (c *Command) AddFlags(optionStruct interface{}) *Command {
// set value of field to default value
value, err := strconv.Atoi(defaultValue)
if err != nil {
panic("Invalid default value for int flag")
panic("Invalid default value for uint flag")
}
field.SetUint(uint64(value))
}
Expand All @@ -371,7 +371,7 @@ func (c *Command) AddFlags(optionStruct interface{}) *Command {
// set value of field to default value
value, err := strconv.Atoi(defaultValue)
if err != nil {
panic("Invalid default value for int flag")
panic("Invalid default value for uint8 flag")
}
field.SetUint(uint64(value))
}
Expand All @@ -381,7 +381,7 @@ func (c *Command) AddFlags(optionStruct interface{}) *Command {
// set value of field to default value
value, err := strconv.Atoi(defaultValue)
if err != nil {
panic("Invalid default value for int flag")
panic("Invalid default value for uint16 flag")
}
field.SetUint(uint64(value))
}
Expand All @@ -391,7 +391,7 @@ func (c *Command) AddFlags(optionStruct interface{}) *Command {
// set value of field to default value
value, err := strconv.Atoi(defaultValue)
if err != nil {
panic("Invalid default value for int flag")
panic("Invalid default value for uint32 flag")
}
field.SetUint(uint64(value))
}
Expand All @@ -401,7 +401,7 @@ func (c *Command) AddFlags(optionStruct interface{}) *Command {
// set value of field to default value
value, err := strconv.Atoi(defaultValue)
if err != nil {
panic("Invalid default value for int flag")
panic("Invalid default value for uint64 flag")
}
field.SetUint(uint64(value))
}
Expand All @@ -411,7 +411,7 @@ func (c *Command) AddFlags(optionStruct interface{}) *Command {
// set value of field to default value
value, err := strconv.ParseFloat(defaultValue, 64)
if err != nil {
panic("Invalid default value for float flag")
panic("Invalid default value for float32 flag")
}
field.SetFloat(value)
}
Expand All @@ -421,7 +421,7 @@ func (c *Command) AddFlags(optionStruct interface{}) *Command {
// set value of field to default value
value, err := strconv.ParseFloat(defaultValue, 64)
if err != nil {
panic("Invalid default value for float flag")
panic("Invalid default value for float64 flag")
}
field.SetFloat(value)
}
Expand Down

0 comments on commit 274b4ac

Please sign in to comment.