5 releases
0.1.4 | Feb 7, 2025 |
---|---|
0.1.3 | Jan 26, 2025 |
0.1.2 | Jan 19, 2025 |
0.1.1 | Jan 13, 2025 |
0.1.0 | Jan 9, 2025 |
#1937 in Command line utilities
463 downloads per month
39KB
693 lines
📝 postit-rs
Dual-licensed under Apache 2.0 or MIT.
Postit is a CLI utility aimed to help you complete your tasks. You can also save your tasks to keep track of them later.
Features
Although postit
is still in early development and it is limited in features,
it effectively serves its intended purpose.
Customization:
- Configuration file (more info in the Configuration section).
- Set your own configuration path using the
POSTIT_CONFIG_PATH
environment variable (by default and convention,postit.toml
).
Supported file formats:
- csv
- json
Display:
- Checked tasks appear crossed out.
- Different colors depending on priority.
high
: redmed
: yellowlow
: bluenone
: white
Configuration
postit's behavior can be changed using the postit.toml
file.
You can check out its possible fields in the docs or down below:
path
: location of the default file where tasks are stored (the-p
or--path
flag can override this).force_drop
: if true, allows dropping tasks without them being checked.force_copy
: if true, allows overwriting files on copy if they already exist.drop_after_copy
: if true, drops files after copying.
Usage
The commands currently available are:
You can also use the --help
flag for additional help on every command.
Examples
Here is a sample of tasks so you try postit
.
// tasks.csv
1,Task,low,false
2,Task,med,false
3,Task,high,true
4,Task,none,true
view
Syntax: postit view
Takes the path
config defined at postit.toml
(or the -p
flag, if provided)
to show the list of current tasks:
postit view
1,Task,low,false
2,Task,med,false
3,Task,high,true
4,Task,none,true
add
Syntax: postit add <TASK>
Adds a task with the format id,content,priority,checked
:
- id: a unique unsigned integer.
- content: text contained.
- priority:
high
,med
,low
ornone
. - checked:
true
orfalse
.
postit add "5,New task,low,false"
1,Task,low,false
2,Task,med,false
3,Task,high,true
4,Task,none,true
5,New task,low,false (new element)
check
Syntax: postit check <IDS>
Checks tasks if they are unchecked.
postit check 2,3
1,Task,low,false
2,Task,med,true (changed)
3,Task,high,true (not changed)
4,Task,none,true
uncheck
Syntax: postit uncheck <IDS>
Unchecks tasks if they are checked.
postit uncheck 2,3
1,Task,low,false
2,Task,med,false (not changed)
3,Task,high,false (changed)
4,Task,none,true
drop
Syntax: postit drop <IDS>
By default, tasks must be checked to be dropped.
postit drop 2,3
1,Task,low,false
2,Task,med,false (not dropped)
// 3,Task,high,true (dropped)
4,Task,none,true
You can set the force_drop
config to true
to drop tasks wether they are checked or not.
postit drop 2,3
1,Task,low,false
// 2,Task,med,false (dropped)
// 3,Task,high,true (dropped)
4,Task,none,true
copy
Syntax: postit copy <OLD_PATH> <NEW_PATH>
Copies a file's contents into another:
postit copy "tasks.csv" "tasks.json"
By default, if the file at <NEW_PATH>
exists, postit
will refuse to
overwrite that file in case you are using that file as a backup or you simply
don't want to overwrite it.
You can set the force_copy
config to true
to overwrite it anyways.
In the other hand, if you want to copy your file and delete the old one, you can
do it by setting the drop_after_copy
config to true
. This will delete the file
located at <OLD_PATH>
.
config
Syntax: postit config <COMMAND>
Used to manage the config file. These are the available commands:
init
: creates thepostit.toml
file.edit
: opens the default editor to change configs.drop
: deletes the config file (default values will be used at runtime).
You can also check the Configuration section where each config field is explained and there is a link to the official docs.
Testing
To run postit's tests, use this command:
cargo test -- --test-threads=1
You can also use tarpaulin
, configured in the tarpaulin.toml
file.
It is slower, but shows line coverage (not branch coverage):
cargo tarpaulin
The reason why tests are run synchronously is to not overwrite existing files, control the execution flow (creation and cleanup of temp files) and keep them as lightweight as possible, as they don't use external dependencies.
Dependencies
~1.8–9MB
~86K SLoC