Gocharm
A personal project to learn how to make a cli with cobra and go.
Make your terminal life easier.
Installation
To install, clone the repo then simply run:
$ make
Let it finish, then:
$ echo 'export PATH="$HOME/go/bin:$PATH"' >> ~/.bash_profile
If you don't have make installed in your machine, then search Google.
Hint: If you're on 'Windows' then install choco, then run:
choco install make
Hint: If you are using termux, just run:
$ pkg install make
Usage
The 'main' command is gocharm
, there are currently two commands (There will be more), a list:
- time
- tasks
Each one with his own functionality.
Time Command
This command displays the REAL TIME of any city you want, for example:
$ gocharm time -t "America/New_York" -1
The "-t" flag tells gocharm what city to look the time of, like the timezone.
The "-1" flag tells gocharm to display the time in 12-Hour Format
Compare Subcommand
There's a subcommand of time that lets you display the time of two different timezones. The Compare Command.
$ gocharm time compare
If don't provide any flag, gocharm will prompt for Timezone 1 and Timezone 2.
Tasks Command
The tasks command is a small and simple task manager, it lets you add and save tasks to a file in your systems, so if you prompted title wrong you can go and modify it.
$ gocharm tasks {<subcommand>}
Here's a list of all subcommands:
- add
- list
- view
- complete
Add subcommand
This subcommand is used to add a new task and save it, have a look at it:
$ gocharm tasks add -t "{<Task Title>}"
This will save the task on the .gocharm.yml file that has been created when you executed 'make'.
NOTE:The file is not always yaml, you will be prompted for the file type.
List subcommand
This subcommand is used to list every single one of your tasks. Look it:
$ gocharm tasks list
For the sake of demonstration, I will show you the output:
✓. {<Task Title>} // Completed
2. {<Other Task Title>} // Pending
If completed will show a ✓ sign and that comment telling you that the task is completed, if the task is not completed it will show the task number.
View subcommand
This subcommand is used to view a single task, Behold the subcommand:
$ gocharm tasks view {<Task Number>}
It will show you the title and the status.
Complete subcommand
This command is used to mark tasks as completed, Look at his terminal eyes:
$ gocharm tasks complete {<Task Number>}
And that's it, the rest of commands will be documented in this file.