Skip to content

Commit 02b08f7

Browse files
committed
convert uppercase/lowercase
1 parent 3d13ad0 commit 02b08f7

File tree

5 files changed

+56
-1
lines changed

5 files changed

+56
-1
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ devd convert solc_sig [event/method signature]
101101
# devd c solc_sig 'event Transfer(address indexed from, address indexed to, uint256 value);'
102102
```
103103

104+
#### Convert input into upper/lower case
105+
106+
```bash
107+
devd convert to_lower_case [input]
108+
# devd c lowercase AA
109+
devd convert to_upper_case [input]
110+
# devd c uppercase aa
111+
```
112+
104113
### Debug tools
105114

106115
#### Compute EVM transaction intrinsic gas

cmd/convert/root.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ func Commands() *cobra.Command {
1717
GetConvertAbiStringCmd(),
1818
GetConvertHexadecimalToDecimalCmd(),
1919
GetConvertSolcSignatureCmd(),
20+
GetConvertToLowerCaseCmd(),
21+
GetConvertToUpperCaseCmd(),
2022
)
2123

2224
return cmd

cmd/convert/to_lower_case.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package convert
2+
3+
import (
4+
"fmt"
5+
"github.com/spf13/cobra"
6+
"strings"
7+
)
8+
9+
// GetConvertToLowerCaseCmd creates a helper command that convert input into lower case
10+
func GetConvertToLowerCaseCmd() *cobra.Command {
11+
cmd := &cobra.Command{
12+
Use: "to_lower_case [text]",
13+
Aliases: []string{"lowercase"},
14+
Short: "Convert input into lower case",
15+
Args: cobra.MinimumNArgs(1),
16+
Run: func(cmd *cobra.Command, args []string) {
17+
fmt.Println(strings.ToLower(strings.Join(args, " ")))
18+
},
19+
}
20+
21+
return cmd
22+
}

cmd/convert/to_upper_case.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package convert
2+
3+
import (
4+
"fmt"
5+
"github.com/spf13/cobra"
6+
"strings"
7+
)
8+
9+
// GetConvertToUpperCaseCmd creates a helper command that convert input into upper case
10+
func GetConvertToUpperCaseCmd() *cobra.Command {
11+
cmd := &cobra.Command{
12+
Use: "to_upper_case [text]",
13+
Aliases: []string{"uppercase"},
14+
Short: "Convert input into upper case",
15+
Args: cobra.MinimumNArgs(1),
16+
Run: func(cmd *cobra.Command, args []string) {
17+
fmt.Println(strings.ToUpper(strings.Join(args, " ")))
18+
},
19+
}
20+
21+
return cmd
22+
}

constants/varcons.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ package constants
44

55
//goland:noinspection GoSnakeCaseUsage
66
var (
7-
VERSION = "1.2.0"
7+
VERSION = "1.3.0"
88
)

0 commit comments

Comments
 (0)