semvec/pypi-packages huggingface dataset:
cliflect 0.0.3
python package for interacting with console
License: MIT
Requires Python: >=3.6

cliflect is a simple package for interacting with console<br/>
**hello world in cliflect**<br/>
*hello.py*
```python
import cliflect
console=cliflect.console()
@console.cmd('print')
def print_command(string):
	console.echo(string)
console.run()
```
running
```bash
$ python hello.py
```
### output
```bash
no options parsed
usage hello.py [option] args

options:
        print

```
running print
```bash
$ python hello.py print "hello from cliflect"
```
### output
```bash
hello from cliflect
```
running an invalid argument
```bash
$ python hello.py test hi
```
### output
```bash
invalid option --> test
usage hello.py [option] args

options:
        print

```


**creating your own home**
```python
import cliflect
console=cliflect.console()
@console.home
def home(option):
	#here option means the invalid option that user entered
	if option:
		#this executes when invalid option entered
		console.echo(f'invalid option "{option}"', color='red')
	else:
		#this executes when no option entered
		console.echo(f'no option entered')
@console.cmd('print')
def print_command(string):
	console.echo(string)
console.run()
````
running
invalid option
```bash
$ python hello.py test
```
### output
```bash
invalid option "test"
```
*in red colour*<br/>
no option
```bash
$ python hello.py
```
### output
```bash
no option entered
```