Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seann-moser/homebrew-caseconvert
homebrew-CaseConvert is a command-line tool for converting text between various cases like camelCase, snake_case, and PascalCase, easily installable via Homebrew.
https://github.com/seann-moser/homebrew-caseconvert
cli converter go homebrew linux open-source
Last synced: 2 months ago
JSON representation
homebrew-CaseConvert is a command-line tool for converting text between various cases like camelCase, snake_case, and PascalCase, easily installable via Homebrew.
- Host: GitHub
- URL: https://github.com/seann-moser/homebrew-caseconvert
- Owner: Seann-Moser
- License: mit
- Created: 2024-07-10T16:27:41.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-16T18:49:59.000Z (5 months ago)
- Last Synced: 2024-10-04T21:42:13.485Z (3 months ago)
- Topics: cli, converter, go, homebrew, linux, open-source
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Install
```bash
brew tap Seann-Moser/CaseConvert
brew install caseconvert
``````bash
git clone [email protected]:Seann-Moser/CaseConvert.git
cd CaseConvert
go mod vendor
go install
```### Example
#### FZF
```bash
./caseconvert conv -h | fzf | awk '{print $2}' | casec conv```
### CLI Tool Usage
The `CaseConvert` CLI tool allows you to convert strings to various case formats. Below are some examples of how to use it based on the provided code.
### Available Flags
- **--input, -i**: Specifies the input string to convert. If not provided, the tool will read from standard input.
- **--snake, -s**: Converts the input to snake_case.
- **--camel, -c**: Converts the input to camelCase.
- **--pascal, -p**: Converts the input to PascalCase.
- **--kebab, -k**: Converts the input to kebab-case.
- **--env, -e**: Converts the input to ENV_VAR_CASE.
- **--case**: Allows specifying a custom case type.### Examples
1. **Convert to Camel Case**:
```bash
./caseconvert conv --input "example text" --camel
```
Output: `exampleText`2. **Convert to Snake Case**:
```bash
./caseconvert conv --input "example text" --snake
```
Output: `example_text`3. **Convert to Pascal Case**:
```bash
./caseconvert conv --input "example text" --pascal
```
Output: `ExampleText`4. **Convert to Kebab Case**:
```bash
./caseconvert conv --input "example text" --kebab
```
Output: `example-text`5. **Convert to Environment Variable Case**:
```bash
./caseconvert conv --input "example text" --env
```
Output: `EXAMPLE_TEXT`6. **Using Standard Input**:
```bash
echo "example text" | ./caseconvert conv --camel
```
Output: `exampleText`This will convert the input string to the specified custom case type.
### Help Command
To display the help message with a list of available commands and options:
```bash
./caseconvert conv --help
```This provides detailed usage instructions and information about all available flags and commands. For more information, visit the [CaseConvert repository](https://github.com/Seann-Moser/CaseConvert).