updated readme
This commit is contained in:
parent
89af9b499b
commit
53245d19fe
1
.gitignore
vendored
1
.gitignore
vendored
@ -32,3 +32,4 @@
|
||||
*.out
|
||||
*.app
|
||||
|
||||
builds/
|
28
.vscode/tasks.json
vendored
Normal file
28
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"tasks": [
|
||||
{
|
||||
"type": "cppbuild",
|
||||
"label": "C/C++: g++ build active file",
|
||||
"command": "/usr/bin/g++",
|
||||
"args": [
|
||||
"-fdiagnostics-color=always",
|
||||
"-g",
|
||||
"${file}",
|
||||
"-o",
|
||||
"${fileDirname}/${fileBasenameNoExtension}"
|
||||
],
|
||||
"options": {
|
||||
"cwd": "${fileDirname}"
|
||||
},
|
||||
"problemMatcher": [
|
||||
"$gcc"
|
||||
],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"detail": "Task generated by Debugger."
|
||||
}
|
||||
],
|
||||
"version": "2.0.0"
|
||||
}
|
30
README.md
30
README.md
@ -4,22 +4,46 @@ A simple C++ program that owofies text
|
||||
|
||||
## Usage
|
||||
|
||||
### normal usage:
|
||||
```bash
|
||||
$ ./owo "Hello, world!"
|
||||
Hewwo, wowld!
|
||||
```
|
||||
|
||||
## Building
|
||||
### from pipe / stdin:
|
||||
```bash
|
||||
$ echo "Hello, world!" | ./owo -p
|
||||
Hewwo, wowld!
|
||||
```
|
||||
|
||||
### from file:
|
||||
```bash
|
||||
$ ./owo -f file.txt
|
||||
Hewwo, wowld!
|
||||
```
|
||||
|
||||
### to file:
|
||||
```bash
|
||||
$ ./owo -o output.txt "Hello, world!"
|
||||
```
|
||||
|
||||
## Building
|
||||
to build the program, run the following command (note that you need g++ installed):
|
||||
```bash
|
||||
$ g++ -o owo owo.cpp
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
archlinux:
|
||||
### archlinux:
|
||||
```bash
|
||||
$ git clone `https://git.alfieking.dev/acetheking987/term-owo-cpp.git`
|
||||
$ cd term-owo-cpp
|
||||
$ makepkg -si
|
||||
```
|
||||
```
|
||||
|
||||
### other distros:
|
||||
download the binary from the releases page or build from source
|
||||
|
||||
## License
|
||||
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
|
8
owo.cpp
8
owo.cpp
@ -34,7 +34,7 @@ int help() {
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
string input, inputfile, outputfile;
|
||||
bool stdin = false;
|
||||
bool _stdin = false;
|
||||
|
||||
if (argc < 2) {
|
||||
cout << owo("No text provided") << endl << endl;
|
||||
@ -50,7 +50,7 @@ int main(int argc, char *argv[]) {
|
||||
outputfile = string(argv[i+1]);
|
||||
i++;
|
||||
} else if (string(argv[i]) == "-p") {
|
||||
stdin = true;
|
||||
_stdin = true;
|
||||
} else if (string(argv[i]) == "-h") {
|
||||
return help();
|
||||
} else if (i == argc-1) {
|
||||
@ -62,7 +62,7 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
if (stdin && inputfile != "" || stdin && input != "" || inputfile != "" && input != "") {
|
||||
if (_stdin && inputfile != "" || _stdin && input != "" || inputfile != "" && input != "") {
|
||||
cout << owo("Cannot use multiple input methods at once") << endl << endl;
|
||||
help();
|
||||
return 1;
|
||||
@ -78,7 +78,7 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
if (stdin) {
|
||||
if (_stdin) {
|
||||
while (getline(cin, input)) {
|
||||
if (outputfile != "") {
|
||||
*output << owo(input) << endl;
|
||||
|
Loading…
Reference in New Issue
Block a user