Open mavimo opened 5 years ago
Thanks @mavimo for this proposal. I agree that there is inconsistency with the command structure, but I see this often in packages that are in the early development phases, which should eventually be refactored.
I needed the debug mode to dump a log file so I used the --debug flag in https://github.com/xetys/hetzner-kube/pull/231 but it is still not available for all commands
@mavimo I'm not a heavy hetzner-kube user, but my $0.02:
All good ideas. The documentation looks helpful.
And also command are not listed by priority (eg. version, help and completion are less relevant that other commands).
Ordering by priority feels like a good idea.
About command consistency, I think many people using hetzner-kube will be familiar with kubctl, so we could take inspiration from it. The command structure is also pretty consistent.
I am totally fine with this proposal. I will add it to our v1.0.0 project.
I'm not using the tool currently, so don't take my opinion too seriously, but I completely agree on the first two points:
--debug
flagAccording the help message. I'd like to see extensive help only if there are only a few options and variations of subcommands. In the other case it makes sense to avoid distraction by hiding help info for subcommands in their own help messages. If I want to see the whole documentation I use man
.
For me the ideal documentation of command line tool is described as follows:
command help
shows a complete description for the tool, a list of global flags in alphabetical order and a list of subcommands in alphabetical order; each item in the list is provided with a short description.command subcommand help
shows information for the subcommand
in the same way described above (a complete description of the subcommand, subcommand global flags and sub-subcommands);Just to clarify why I prefer alphabetical order instead of priority order.
alphabetical order:
priority order:
@Zebradil thx for info you share with us; about using man
I'm not sure it's the right approach since this is a single executable binary that will be installed via:
wget http://... -o /usr/local/sbin/hetzner-kube
chmod +x /usr/local/sbin/hetzner-kube
/usr/local/sbin/hetzner-kube ...
So there is no setup process as we have via RPM / DEB / Windows Wizard, so I'm not sure have man page should be useful (is not "wrong" but I think is a feature that can be useful as "extra").
About command sorting you're right, is not easy to detect what command should be "on top" but I think some commands as "less useful" (eg help
, completion
or version
, and yes, it's absolutely subjective 😄 ) and can be moved "at the end", but is not easy define order for other commands.
Maybe we can consider to split commands in two "macro section" (operational & utility) and then -for each of this section- add command in alphabetical order?
@jcassee 👍 to use args as kubectl
since most of our users will become from this tool, so have the same "approach" I think should be the best approach to give users a good experience.
Hi guys, there are some "bug" on user experience and I'll like to fix it, but before start I think we should find a solution that should match the expectation of much people as possibile.
Command consistency
As end-user there are command that are not consistent on usage, some time we use flag, some time we need to user args, eg:
hetzner-cloud context delete
use arg do indicate the name of context to deletehetzner-cloud ssh-key delete
use flag do indicate the name of ssh-key to deletehetzner-cloud cluster delete
use flag do indicate the name of cluster to deleteSame for
hetzner-cloud context add
use arg do indicate the name of context to addhetzner-cloud ssh-key add
use flag do indicate the name of ssh-key to addhetzner-cloud cluster add
use flag do indicate the name of cluster to addetc.
Maybe we should define the standard behaviour we will like to use and refactor other commands in order to be consistent.
Debug mode
There is a
--debug
flag defined on the root command but other command do not honor it, maybe we should allow all command to use this information when required.Command listing
The
hetzner-cloud
list only the first level command, so user should enter in each command to detect the list of available subcommand, maybe we should list all command we have as doc? Something like:And also command are not listed by priority (eg.
version
,help
andcompletion
are less relevant that other commands).@xetys @JohnnyQQQQ @gadelkareem @voron @pierreozoux @cice @dsteiman @lilvinz @eliasp @Baughn @MartinNowak @zozo @felixonmars @quorak @lfrancke @kabudu @meMo-Minsk @pushthat @jcassee @Zebradil @namxam @eliasp @hojerst @thordin9 @exocode @torgon @EamonKeane @kabudu @rvasilev any opinion? (sorry if I ping you, but as reported above having large feedback should be the first step here :D )
PS: maybe some other DX issue are missing, please report it and I'll update this doc ASAP.