mirror of
https://github.com/sharkdp/bat.git
synced 2026-10-30 10:06:12 +00:00
Combine OutputComponents and PredefinedStyles
This commit tries to simply the change. Instead of separating an `OutputComponent` and a `PredefinedStyle`, I have combined the two into just `OutputComponent`. To still have the styles work, I added an impl to `OutputComponent` with a function `components` which returns the components related to the specified component. For a simple output component this is trivial, but for the predefined styles this is a list of other components. The evaluating of the command-line parameter simplified significantly, making use of Claps `values_t!` macro to parse the supplied parameters into a `Vec<OutputComponent>`. After that it is simply a task of combining all supplied output components into one vector. Important: this means that the styles are now additive, rather than one of the predefined styles overruling other parameters supplied.
This commit is contained in:
1 parent
23813cc08b
commit
389edd7239
3 files changed
+31
-96
No files matched your search
@@ -13,7 +13,6 @@ version = "0.3.0"
|
||||
atty = "0.2.2"
|
||||
ansi_term = "0.10"
|
||||
console = "0.6"
|
||||
either = "1.4"
|
||||
error-chain = "0.11"
|
||||
directories = "0.10"
|
||||
lazy_static = "1.0"
|
||||
|
||||
Reference in new issue
Block a user