diff --git a/cmd/finder_opts.go b/cmd/finder_opts.go index b1a6b39..a8b7566 100644 --- a/cmd/finder_opts.go +++ b/cmd/finder_opts.go @@ -11,31 +11,31 @@ import ( // Filtering holds filtering options to select notes. type Filtering struct { - Path []string `arg optional placeholder:""` - - Match string `short:"m" placeholder:"" help:"Terms to search for in the notes."` - Limit int `short:"n" placeholder:"" help:"Limit the number of results."` - Created string ` placeholder:"" help:"Only the notes created on the given date."` - CreatedBefore string ` placeholder:"" help:"Only the notes created before the given date."` - CreatedAfter string ` placeholder:"" help:"Only the notes created after the given date."` - Modified string ` placeholder:"" help:"Only the notes modified on the given date."` - ModifiedBefore string ` placeholder:"" help:"Only the notes modified before the given date."` - ModifiedAfter string ` placeholder:"" help:"Only the notes modified after the given date."` - Related []string ` help:"Only the notes which might be related to the given notes." xor:"link"` - LinkedBy []string `short:"l" placeholder:"" help:"Only the notes linked by the given notes." xor:"link"` - LinkingTo []string `short:"L" placeholder:"" help:"Only the notes linking to the given notes." xor:"link"` - NotLinkedBy []string ` placeholder:"" help:"Only the notes not linked by the given notes." xor:"link"` - NotLinkingTo []string ` placeholder:"" help:"Only the notes not linking to the given notes." xor:"link"` - MaxDistance int ` help:"Maximum distance between two linked notes."` - Orphan bool ` help:"Only the notes which don't have any other note linking to them."` - Exclude []string `short:"x" placeholder:"" help:"Excludes notes matching the given file path pattern from the list."` - Recursive bool `short:"r" help:"Follow links recursively."` - Interactive bool `short:"i" help:"Further filter the list of notes interactively."` + Path []string `group:filter arg optional placeholder:PATH help:"Find notes matching the given path, including its descendants."` + + Interactive bool `group:filter short:i help:"Select notes interactively with fzf."` + Limit int `group:filter short:n placeholder:COUNT help:"Limit the number of notes listed."` + Match string `group:filter short:m placeholder:QUERY help:"Terms to search for in the notes."` + Exclude []string `group:filter short:x placeholder:PATH help:"Do not list notes matching the given path, including its descendants."` + Orphan bool `group:filter help:"Find notes which are not linked by any other note." xor:link` + LinkedBy []string `group:filter short:l placeholder:PATH help:"Find notes which are linked by the given ones." xor:link` + LinkingTo []string `group:filter short:L placeholder:PATH help:"Find notes which are linking to the given ones." xor:link` + NotLinkedBy []string `group:filter placeholder:PATH help:"Find notes which are not linked by the given ones." xor:link` + NotLinkingTo []string `group:filter placeholder:PATH help:"Find notes which are not linking to the given notes." xor:link` + Related []string `group:filter placeholder:PATH help:"Find notes which might be related to the given ones." xor:link` + MaxDistance int `group:filter placeholder:COUNT help:"Maximum distance between two linked notes."` + Recursive bool `group:filter short:r help:"Follow links recursively."` + Created string `group:filter placeholder:DATE help:"Find notes created on the given date."` + CreatedBefore string `group:filter placeholder:DATE help:"Find notes created before the given date."` + CreatedAfter string `group:filter placeholder:DATE help:"Find notes created after the given date."` + Modified string `group:filter placeholder:DATE help:"Find notes modified on the given date."` + ModifiedBefore string `group:filter placeholder:DATE help:"Find notes modified before the given date."` + ModifiedAfter string `group:filter placeholder:DATE help:"Find notes modified after the given date."` } // Sorting holds sorting options to order notes. type Sorting struct { - Sort []string `short:"s" placeholder:"" help:"Sort the notes by the given criterion."` + Sort []string `group:sort short:s placeholder:TERM help:"Sort the listed notes by the given criterion."` } // NewFinderOpts creates an instance of note.FinderOpts from a set of user flags. diff --git a/cmd/list.go b/cmd/list.go index 86e91a8..f4cffe9 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -8,23 +8,28 @@ import ( "github.com/mickael-menu/zk/adapter/fzf" "github.com/mickael-menu/zk/adapter/sqlite" "github.com/mickael-menu/zk/core/note" - "github.com/mickael-menu/zk/util/errors" "github.com/mickael-menu/zk/util/opt" "github.com/mickael-menu/zk/util/strings" ) // List displays notes matching a set of criteria. type List struct { - Format string `help:"Pretty prints the list using the given format." short:"f" placeholder:"