From 1357e49cb2df3a65cf67e999d61ae12b02add79c Mon Sep 17 00:00:00 2001 From: blob42 Date: Fri, 11 Oct 2024 03:50:33 +0200 Subject: [PATCH] chore: comments + lint Signed-off-by: blob42 --- browsers/firefox/cli_commands.go | 12 ++++++------ cmd/gosuki/main.go | 3 ++- pkg/config/config.go | 2 +- pkg/modules/common.go | 16 ++++++++-------- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/browsers/firefox/cli_commands.go b/browsers/firefox/cli_commands.go index b434588..b44a499 100644 --- a/browsers/firefox/cli_commands.go +++ b/browsers/firefox/cli_commands.go @@ -38,6 +38,7 @@ var fflog = logging.GetLogger("FF") var ( ffUnlockVFSCmd = cli.Command{ Name: "unlock", + Usage: "Remove VFS lock from places.sqlite", Aliases: []string{"u"}, Action: ffUnlockVFS, } @@ -53,9 +54,9 @@ var ( Usage: "VFS locking commands", Subcommands: []*cli.Command{ &ffUnlockVFSCmd, - &ffCheckVFSCmd, - }, -} + &ffCheckVFSCmd, + }, + } ffListProfilesCmd = cli.Command{ Name: "list", @@ -88,8 +89,8 @@ func init() { cmd.RegisterModCommand(BrowserName, FirefoxCmds) } -//TODO: #54 define interface for modules to handle and list profiles -//FIX: Remove since profile listing is implemented at the main module level +// TODO: #54 define interface for modules to handle and list profiles +// FIX: Remove since profile listing is implemented at the main module level func ffListProfiles(_ *cli.Context) error { flavours := FirefoxProfileManager.ListFlavours() for _, f := range flavours { @@ -106,7 +107,6 @@ func ffListProfiles(_ *cli.Context) error { } } - return nil } diff --git a/cmd/gosuki/main.go b/cmd/gosuki/main.go index 1a767b7..635edab 100644 --- a/cmd/gosuki/main.go +++ b/cmd/gosuki/main.go @@ -49,6 +49,8 @@ func main() { app := cli.NewApp() app.Name = "gosuki" + app.Description = "TODO: summary gosuki description" + app.Usage = "swiss-knife bookmark manager" app.Version = utils.Version() flags := []cli.Flag{ @@ -58,7 +60,6 @@ func main() { Name: "config", Aliases: []string{"c"}, Value: config.ConfigFile(), - Usage: "load config from `FILE`", DefaultText: "~/.config/gosuki/config.toml", Category: "_", }, diff --git a/pkg/config/config.go b/pkg/config/config.go index 0bcbaa3..5cba05f 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -137,7 +137,7 @@ func GetModuleOption(module string, opt string) (interface{}, error) { // Register a module option ie. under [module] in toml file // If the module is not a configurator, a simple map[string]interface{} will be -// created for it. +// created for it. use [GetModuleOption] func RegisterModuleOpt(module string, opt string, val interface{}) error { log.Debugf("Setting option for module <%s>: %s = %v", module, opt, val) if _, ok := configs[module]; !ok { diff --git a/pkg/modules/common.go b/pkg/modules/common.go index 975d223..fee6d18 100644 --- a/pkg/modules/common.go +++ b/pkg/modules/common.go @@ -154,14 +154,14 @@ func RegisterModule(module Module) { //TODO: Register by ID registeredModules = append(registeredModules, module) - //WIP: - switch module.(type) { - case watch.IntervalFetcher: - fmt.Println("this is interval fetcher") - - case watch.WatchRunner: - fmt.Println("this is watch runner") - } + //WIP: custom handling of watcher types + // switch module.(type) { + // case watch.IntervalFetcher: + // fmt.Println("this is interval fetcher") + // + // case watch.WatchRunner: + // fmt.Println("this is watch runner") + // } } // Returns a list of registerd browser modules