From 2971c11e1681f14993cbef04dc48023fb123ad98 Mon Sep 17 00:00:00 2001 From: GeopJr Date: Tue, 22 Sep 2020 07:23:56 +0300 Subject: [PATCH] Fix: --plugins option --- README.md | 11 +++++++++++ src/crycord.cr | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index de24e48..d041c05 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,17 @@ Done! Restart Discord to see the results! ``` +## Plugins +| Name | Group | Description | Maintainer | +| :-----------------: | :---: | :------------------------: | :--------: | +| enable_https | core | Disables CSP | GeopJr | +| enable_css | core | Enables css injection | GeopJr | +| unrestricted_resize | extra | Removes window size limits | GeopJr | + +To enable groups of plugins use `$ crycord -g core,extra -c /path/to/css` + +> Note: `core` is enabled by default so there's no need to include it. + ## Benchmarks Crycord: diff --git a/src/crycord.cr b/src/crycord.cr index cbde758..2302d17 100644 --- a/src/crycord.cr +++ b/src/crycord.cr @@ -62,10 +62,10 @@ module Crycord should_revert = true end parser.on "-p", "--plugins", "Lists all available plugins" do - available_plugins = Crycord::PLUGINS.keys.map { |x| x = Crycord::PLUGINS[x].name + " | " + Crycord::PLUGINS[x].category + " | " + Crycord::PLUGINS[x].desc }.uniq + available_plugins = Crycord::PLUGINS.keys.reject! { |x| Crycord::PLUGINS[x].disabled }.map { |x| x = Crycord::PLUGINS[x].name + " | " + Crycord::PLUGINS[x].category + " | " + Crycord::PLUGINS[x].desc }.uniq puts "Available plugins:" puts "NAME | GROUP | DESCRIPTION" - puts available_plugins.reject! { |x| Crycord::PLUGINS[x].disabled }.join("\n") + puts available_plugins.join("\n") puts "Note: Disabled plugins are omitted" exit end