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
So my idea for the CLI was to specify the optional flags in the usage text.
For example, for the alerts-add command we have the following usage :
NAME:
scalingo alerts-add - Add an alert to an application
USAGE:
scalingo alerts-add [command options] [arguments...]
....
As you see, the usage isn't explicit at all.
The command actually have 3 required flags, and 4 optional flags.
Actually, nothing specifies the optional flags expect in the description :
CATEGORY:
Alerts
DESCRIPTION:
Add an alert to an application metric.
The "duration-before-trigger", "remind-every", "below" and "notifiers" flags are optionnal
Example
...
But this should not be
Technically, following the POSIX Utility Conventions, the usage should contains the flags and arguments that :
Are optional are surrounded by brackets [--optional-flag]
Are required aren't surrounded by anything
The usage for this command should be :
scalingo alerts-add --container-type value --metric value --limit value [--duration-before-trigger value]
Or the short version :
scalingo alerts-add -c value -m value -l value [--duration-before-trigger value] [-r value] [-b value] [-n value]
On the paper this is simple. BUT the library we use (urfave/cli) doesn't permit us to customize the usage that much. I struggled a lot reading the source code of the library, thinking about how I could do, to resign that it wasn't possible.
We can provide a CustomUsageTemplate, but in order to correctly fill the usage, we need more information that would need a pull request to urfave/cli to change the library's code.
The text was updated successfully, but these errors were encountered:
So my idea for the CLI was to specify the optional flags in the usage text.
For example, for the alerts-add command we have the following usage :
As you see, the usage isn't explicit at all.
The command actually have 3 required flags, and 4 optional flags.
Actually, nothing specifies the optional flags expect in the description :
But this should not be
Technically, following the POSIX Utility Conventions, the usage should contains the flags and arguments that :
The usage for this command should be :
Or the short version :
On the paper this is simple. BUT the library we use (urfave/cli) doesn't permit us to customize the usage that much. I struggled a lot reading the source code of the library, thinking about how I could do, to resign that it wasn't possible.
We can provide a CustomUsageTemplate, but in order to correctly fill the usage, we need more information that would need a pull request to urfave/cli to change the library's code.
The text was updated successfully, but these errors were encountered: