diff options
author | Matthias Beyer <matthias.beyer@atos.net> | 2019-04-25 09:48:52 +0200 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@atos.net> | 2019-04-25 09:48:52 +0200 |
commit | 524336a3335aaf49274a3bc4a177990c791a75c7 (patch) | |
tree | ad946019435e45ad466b499929f1d750d5a98406 | |
parent | 23571d048e9f05b2bdef9e80bb5d8ef1673ca7d8 (diff) |
Add doc: All Frontend implementations
-rw-r--r-- | src/frontend/json.rs | 9 | ||||
-rw-r--r-- | src/frontend/list.rs | 3 | ||||
-rw-r--r-- | src/frontend/table.rs | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/frontend/json.rs b/src/frontend/json.rs index cd7e651..b9d2007 100644 --- a/src/frontend/json.rs +++ b/src/frontend/json.rs @@ -15,6 +15,15 @@ use librepology::v1::api::Api; pub struct JsonFrontend(Stdout); +/// A Frontend that serializes the data to JSON +/// +/// Useful for piping the data as structured data to another program. +/// +/// # Warning +/// +/// This frontend does _not_ maintain compatibility with repolocli itself. That means that piping +/// output from repolocli to repolocli is _NOT_ supported by this frontend. +/// impl JsonFrontend { pub fn new(stdout: Stdout) -> Self { JsonFrontend(stdout) diff --git a/src/frontend/list.rs b/src/frontend/list.rs index e870ab0..e4ed7d7 100644 --- a/src/frontend/list.rs +++ b/src/frontend/list.rs @@ -15,6 +15,9 @@ use librepology::v1::api::Api; pub struct ListFrontend(Stdout); +/// A Frontend that prints the data in a human-readable way but without ASCII-art. +/// +/// It seperates the values with dashes ("-") for a slightly better reading experience. impl ListFrontend { pub fn new(stdout: Stdout) -> Self { ListFrontend(stdout) diff --git a/src/frontend/table.rs b/src/frontend/table.rs index 6a30e9c..ba5c21d 100644 --- a/src/frontend/table.rs +++ b/src/frontend/table.rs @@ -13,6 +13,7 @@ use crate::backend::Backend; use crate::compare::ComparePackage; use librepology::v1::api::Api; +/// A Frontend that formats the output in a nice ASCII-art table pub struct TableFrontend(Stdout); impl TableFrontend { |