From 524336a3335aaf49274a3bc4a177990c791a75c7 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 25 Apr 2019 09:48:52 +0200 Subject: Add doc: All Frontend implementations --- src/frontend/json.rs | 9 +++++++++ src/frontend/list.rs | 3 +++ src/frontend/table.rs | 1 + 3 files changed, 13 insertions(+) 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 { -- cgit v1.2.3