From ef4ca70eedb22b8186907fdfcc53abd0c513ce05 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Sun, 27 Oct 2024 21:59:57 +0100 Subject: [PATCH] fix: use ? suffit for boolean variables --- src/commands/global_tui.cr | 2 +- src/commands/mapping_mount.cr | 2 +- src/config.cr | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/global_tui.cr b/src/commands/global_tui.cr index 9b162dd..0b71acd 100644 --- a/src/commands/global_tui.cr +++ b/src/commands/global_tui.cr @@ -20,7 +20,7 @@ module GX::Commands filesystem = @file_system_manager.choose_filesystem raise Models::InvalidFilesystemError.new("Invalid filesystem") if filesystem.nil? @file_system_manager.mount_or_umount(filesystem) - @file_system_manager.auto_open(filesystem) if filesystem.mounted? && @config.auto_open + @file_system_manager.auto_open(filesystem) if filesystem.mounted? && @config.auto_open? end def self.handles_mode diff --git a/src/commands/mapping_mount.cr b/src/commands/mapping_mount.cr index 9e896eb..7f2a1af 100644 --- a/src/commands/mapping_mount.cr +++ b/src/commands/mapping_mount.cr @@ -20,7 +20,7 @@ module GX::Commands filesystem = @file_system_manager.choose_filesystem raise Models::InvalidFilesystemError.new("Invalid filesystem") if filesystem.nil? filesystem.mount - @file_system_manager.auto_open(filesystem) if filesystem.mounted? && @config.auto_open + @file_system_manager.auto_open(filesystem) if filesystem.mounted? && @config.auto_open? end def self.handles_mode diff --git a/src/config.cr b/src/config.cr index dfba077..78bbbcc 100644 --- a/src/config.cr +++ b/src/config.cr @@ -31,11 +31,11 @@ module GX getter home_dir : String getter root : Models::RootConfig? - property verbose : Bool + property? verbose : Bool property mode : Types::Mode property path : String? property args : AddArgs.class | DelArgs.class | NoArgs.class - property auto_open : Bool + property? auto_open : Bool # FIXME: refactor and remove these parts from here property help_options : Parsers::Options::HelpOptions?