Skip to content

About

Reimplementation of my C project in Rust

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

snippethold

A minimal CLI tool written in Rust to store, read, list, and delete snippet files locally.

Snippets are stored as plain files under ~/.config/.snippethold/ (or /tmp/.config/.snippethold/ if $HOME is not set).

Installation

Prerequisites

  • Rust and cargo installed.

Building from source

git clone https://github.com/TechCore3/snippethold-rs.git
cd snippethold-rs
cargo build --release

The compiled binary will be located at target/release/snippethold.

You can also install it

cargo install --path .

The compiled binary will be located at ~/.cargo/bin/snippethold

Usage

snippethold usage:
  snippethold -s  <file> <contents> (stores file)
  snippethold -S  <file> 		    (shows file)
  snippethold -l         		    (lists files)
  snippethold -r  <file> 			(removes viles)

Save a snippet (-s)

Save a snippet directly by passing the content as an argument:

snippethold -s my_snippet.txt "echo 'hello world'"

Or pipe input from stdin:

cat script.sh | snippethold -s my_snippet.txt

View a snippet (-S)

Print the contents of a single snippet file to stdout:

snippethold -S my_snippet.txt

List all snippets (-l)

List the file paths of all saved snippets:

snippethold -l

Remove a snippet (-r)

Delete a stored snippet file:

snippethold -r my_snippet.txt

Storage

All files are created inside:

  • $HOME/.config/.snippethold/
  • /tmp/.config/.snippethold/ (fallback if $HOME is unset)

License

This project is licensed under the GNU General Public License v3.0 - see the [LICENSE]

About

Reimplementation of my C project in Rust

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages