fjall_cli/lib.rs
1//! ## Command
2//!
3//! The command requires `--db <PATH>` or `FJALL_DB`.
4//!
5//! ## Subcommands
6//!
7//! * `keyspace <KEYSPACE> <SUBCOMMAND>` runs keyspace-scoped operations:
8//! `iter`, `get`, `insert`, `contains`, `len`, `clear`, `delete`.
9//! * `list-keyspace-names` lists keyspace names (one per line).
10//! * `keyspace-count` prints the number of keyspaces.
11//!
12//! Exit codes for `keyspace <KEYSPACE> contains <KEY>`:
13//! * `0` - key exists
14//! * `1` - error occurred
15//! * `127` - key does not exist
16//!
17//! ## Byte encodings
18//!
19//! Commands that accept key/value bytes support `--*-encoding` with:
20//! * `string` (default)
21//! * `hex`
22//! * `path`
23//! * `empty` (argument must be exactly `-`)
24//!
25//! ## Example
26//!
27//! ```bash
28//! DB_DIR="$(mktemp -d)"
29//! export FJALL_DB="$DB_DIR"
30//!
31//! fjall keyspace items insert key value
32//! fjall keyspace items len
33//! # 1
34//!
35//! fjall keyspace-count
36//! # 1
37//!
38//! fjall keyspace items contains key
39//! # exit code: 0
40//! fjall keyspace items contains missing
41//! # exit code: 127
42//!
43//! fjall keyspace items get key
44//! # value
45//!
46//! fjall keyspace items iter --key-suffix ":" --value-suffix $'\n'
47//! # key:value
48//!
49//! fjall list-keyspace-names
50//! # items
51//!
52//! fjall keyspace items clear
53//! fjall keyspace items len
54//! # 0
55//!
56//! fjall keyspace items delete
57//! fjall keyspace-count
58//! # 0
59//! ```
60
61mod command;
62
63pub use command::*;
64
65mod types;
66
67pub use types::*;