brew tap Seann-Moser/CaseConvert
brew install caseconvertgit clone git@github.com:Seann-Moser/CaseConvert.git
cd CaseConvert
go mod vendor
go install./caseconvert conv -h | fzf | awk '{print $2}' | casec conv
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.
- --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.
-
Convert to Camel Case:
./caseconvert conv --input "example text" --camelOutput:
exampleText -
Convert to Snake Case:
./caseconvert conv --input "example text" --snakeOutput:
example_text -
Convert to Pascal Case:
./caseconvert conv --input "example text" --pascalOutput:
ExampleText -
Convert to Kebab Case:
./caseconvert conv --input "example text" --kebabOutput:
example-text -
Convert to Environment Variable Case:
./caseconvert conv --input "example text" --envOutput:
EXAMPLE_TEXT -
Using Standard Input:
echo "example text" | ./caseconvert conv --camel
Output:
exampleText
This will convert the input string to the specified custom case type.
To display the help message with a list of available commands and options:
./caseconvert conv --helpThis provides detailed usage instructions and information about all available flags and commands. For more information, visit the CaseConvert repository.