Repository navigation
feat(config): redesign generated CLI flags - #13
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a major refactor of how global options are presented and handled in the CLI, along with several usability improvements and some minor fixes. The most significant change is the introduction of a system for categorizing and displaying global flags relevant to each command, ensuring that help output is clearer and only shows applicable global options. Several commands now explicitly declare their relevant global flag categories, and the help system has been updated to reflect these changes. There are also improvements to flag naming consistency and the addition of useful flag aliases.
CLI Help System Refactor and Global Flag Categorization
cmd/help.go) to display only relevant global options per command, with improved templates and logic for showing local and global options. Added functions to configure and filter visible global flag categories, and updated help output to reference global configuration overrides. [1] [2] [3]cmd/help_test.go, ensuring correct visibility and categorization for all commands.Command Metadata and Flag Declarations
cmd/import/import.go,cmd/logs.go,cmd/model/model.go,cmd/model/list.go,cmd/model/pull.go,cmd/model/clear.go,cmd/recipe/recipe.go,cmd/recipe/backup.go,cmd/recipe/keyword.go,cmd/recipe/normalize.go,cmd/recipe/restore.go,cmd/configure.go,cmd/genkit.go) to declare their relevant global flag categories in theirMetadatausingcliutil.GlobalFlagMetadata(...). [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]Flag and Option Usability Improvements
--replace/-r,--all/-a,--failed/-f,--new/-n) incmd/recipe/keyword.goandcmd/recipe/normalize.gofor improved CLI ergonomics. [1] [2]cmd/import/import.goby removing thevideo.prefix fromcookies-fileandcookies-from-browserflags, and set the correct category for the--dry-runflag.Minor Fixes and Documentation
README.mdto clarify how environment variables are mapped from config keys, and fixed an example for the--tandoor-urlglobal flag.--modelflag from "GENERAL OPTIONS" to "PROVIDER OPTIONS" incmd/root.gofor better grouping.Internal Consistency and Bug Fixes
ignorefield tokeepin the keyword assignment logic to better reflect its purpose and updated all references accordingly incmd/recipe/keyword.go. [1] [2] [3]These changes collectively improve the clarity, usability, and maintainability of the CLI, especially around help output and global option handling.