add isOptional prop to CLI commands (#10995)

* add isOptional prop to CLI commands

* fix: add required field to flag type

* chore: fix indentation

Co-authored-by: Han Qiao <sweatybridge@gmail.com>
This commit is contained in:
Jonathan Summers-MuirandHan Qiao authored and GitHub committed 2022-12-15 17:08:55 +08:00
1 parent a2b2e815c1
commit 16c9ab575f
1 file changed
+2 -1
@@ -27,6 +27,7 @@ export type Flag = {
description: string
default_value: string
accepted_values: AcceptedValue[]
required?: boolean
}
export type AcceptedValue = {
@@ -107,7 +108,7 @@ const CliCommandSection = (props) => {
{command.flags.map((flag: Flag) => (
<>
<li className="mt-0">
<Param {...flag}>
<Param {...flag} isOptional={!flag.required}>
{flag?.accepted_values && (
<Options>
{flag?.accepted_values.map((value) => {