Граф коммитов

11 Коммитов

Автор SHA1 Сообщение Дата
David Karlsson ea2c7ca089 fix: generate long desc and examples for root command
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-07-02 15:03:26 +02:00
CrazyMax be388bff2a
add man support
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2024-02-22 13:29:38 +01:00
Sebastiaan van Stijn 15a6d25b68
use custom annotation for aliases
Cobra allows for aliases to be defined for a command, but only allows these
to be defined at the same level (for example, `docker image ls` as alias for
`docker image list`). Our CLI has some commands that are available both as a
top-level shorthand as well as `docker <object> <verb>` subcommands. For example,
`docker ps` is a shorthand for `docker container ps` / `docker container ls`.

This patch introduces a custom "aliases" annotation that can be used to print
all available aliases for a command. While this requires these aliases to be
defined manually, in practice the list of aliases rarely changes, so maintenance
should be minimal.

As a convention, we could consider the first command in this list to be the
canonical command, so that we can use this information to add redirects in
our documentation in future.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-29 02:00:12 +02:00
Sebastiaan van Stijn 23f22d3ca8
use full command as aliases
The default output for Cobra aliases only shows the subcommand as alias, which
is not very intuitive. This patch changes the output to use the full command
as it would be called by the user.

Before this patch:

    aliases: build, b

After this patch:

    aliases: docker buildx build, docker buildx b

Note that there's still some improvements to be made; due to how aliases must be
set-up in Cobra, aliases at different "levels" are still not shown. So for example,
`docker build --help` will not show `docker buildx build` as alias, and vice-versa.
This will require additional changes, and can possibly be resolved using custom
metadata/annotations.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-28 12:07:52 +02:00
CrazyMax c712d9e559
annotation to specify code delimiter for flag usage
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-11-22 10:33:20 +01:00
CrazyMax 1ceaf72fde
fix desync file copying
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-11-04 16:11:15 +01:00
CrazyMax 669397c81c
always disable the addition of [flags] to the usage
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-11-04 13:39:10 +01:00
CrazyMax e9f8b8c6e3
fix persistent flags
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-11-04 11:37:01 +01:00
Sebastiaan van Stijn 7cf6fd0546
remove github.com/pkg/errors dependency
While pkg/errors ia a great utility, I don't think it's adding enough value
in this specific project to make it worth being an extra dependency.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-11-04 10:00:03 +01:00
CrazyMax 67f339f2be
New opts for setting target and plugin capabilities
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-10-15 18:04:30 +02:00
CrazyMax 40b1fb6971
Rename project
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-08-20 15:55:23 +02:00