You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue tracks the ability to add command line argument groups. This is useful to help displaly information on any invocation of the --help flag and to show flags which are part of either a common area, subsystem or category.
For example, all configuration options for KraftKit should be grouped together (see #35) as "global options".
to annotate a flag against a group alias name. E.g. the annotation group:global would be the annotation and the "key" would be "global". When the help command is invoked, the key could be looked up against an index of group names, where "global" would correspond to the string "Global flags".
Not sure where group names should be saved though. Perhaps it should be possible via the cmdutil library to register a new group, e.g. a publicaly exposed API cmdutil.RegisterNewFlagGroup(key, title string) which saves to a local variable map which is then referenced (in the same vein as cmdutil.RegisterFlag).
This commit allows us to specify which group a subcommand belongs to
which allows for an easier-to-navigate help command output. For now, 3
groups are provided: "build", "pkg" and "run" which display a set of
subcommands (and sub-sub-commands) which are part of the same group. A
modificaiton to all current subcommand programs in KraftKit are made,
using this new system based on cobra's annotation system.
GitHub-Fixes: unikraft#36
Signed-off-by: Alexander Jung <alex@unikraft.io>
This issue tracks the ability to add command line argument groups. This is useful to help displaly information on any invocation of the
--help
flag and to show flags which are part of either a common area, subsystem or category.For example, all configuration options for KraftKit should be grouped together (see #35) as "global options".
kraftkit/internal/cmdutil/help.go
Lines 53 to 59 in 1b07bef
The text was updated successfully, but these errors were encountered: