Skip to content

Commit

Permalink
chore: improve read cli command docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yordis committed Jan 30, 2025
1 parent 0508dd6 commit 07204a3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "stable"
10 changes: 10 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ enum Commands {

/// Create a stream.
CreateStream {
/// Format: s2://<basin>/<stream>
#[arg(value_name = "S2_URI")]
uri: S2BasinAndStreamUri,

Expand All @@ -179,18 +180,21 @@ enum Commands {

/// Delete a stream.
DeleteStream {
/// Format: s2://<basin>/<stream>
#[arg(value_name = "S2_URI")]
uri: S2BasinAndStreamUri,
},

/// Get stream config.
GetStreamConfig {
/// Format: s2://<basin>/<stream>
#[arg(value_name = "S2_URI")]
uri: S2BasinAndStreamUri,
},

/// Reconfigure a stream.
ReconfigureStream {
/// Format: s2://<basin>/<stream>
#[arg(value_name = "S2_URI")]
uri: S2BasinAndStreamUri,

Expand All @@ -201,6 +205,7 @@ enum Commands {

/// Get the next sequence number that will be assigned by a stream.
CheckTail {
/// Format: s2://<basin>/<stream>
#[arg(value_name = "S2_URI")]
uri: S2BasinAndStreamUri,
},
Expand All @@ -210,6 +215,7 @@ enum Commands {
/// Trimming is eventually consistent, and trimmed records may be visible
/// for a brief period.
Trim {
/// Format: s2://<basin>/<stream>
#[arg(value_name = "S2_URI")]
uri: S2BasinAndStreamUri,

Expand All @@ -235,6 +241,7 @@ enum Commands {
/// Note that fencing is a cooperative mechanism,
/// and it is only enforced when a token is provided.
Fence {
/// Format: s2://<basin>/<stream>
#[arg(value_name = "S2_URI")]
uri: S2BasinAndStreamUri,

Expand All @@ -254,6 +261,7 @@ enum Commands {

/// Append records to a stream.
Append {
/// Format: s2://<basin>/<stream>
#[arg(value_name = "S2_URI")]
uri: S2BasinAndStreamUri,

Expand Down Expand Up @@ -281,6 +289,7 @@ enum Commands {
/// If a limit if specified, reading will stop when the limit is reached or there are no more records on the stream.
/// If a limit is not specified, the reader will keep tailing and wait for new records.
Read {
/// Format: s2://<basin>/<stream>
#[arg(value_name = "S2_URI")]
uri: S2BasinAndStreamUri,

Expand Down Expand Up @@ -308,6 +317,7 @@ enum Commands {

/// Ping the stream to get append acknowledgement and end-to-end latencies.
Ping {
/// Format: s2://<basin>/<stream>
#[arg(value_name = "S2_URI")]
uri: S2BasinAndStreamUri,

Expand Down
1 change: 1 addition & 0 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ impl FromStr for S2BasinAndMaybeStreamUri {
}
}

/// Format: s2://<basin>/<stream>
#[derive(Debug, Clone)]
pub struct S2BasinAndStreamUri {
pub basin: BasinName,
Expand Down

0 comments on commit 07204a3

Please sign in to comment.