/*! * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {Fragment, h} from 'preact'; import {CliCommandRenderable} from '../entities/renderables.mjs'; import {REFERENCE_MEMBERS} from '../styling/css-classes.mjs'; import {CliCard} from './cli-card'; import {HeaderCli} from './header-cli'; import {RawHtml} from './raw-html'; import {SectionHeading} from './section-heading'; /** Component to render a CLI command reference document. */ export function CliCommandReference(entry: CliCommandRenderable) { return (
{[entry.name, ...entry.aliases].map((command) => (
              
                
ng {commandName(entry, command)} {entry.argumentsLabel && ( {entry.argumentsLabel} )} {entry.optionsLabel && ( {entry.optionsLabel} )}
))} {entry.subcommands && entry.subcommands?.length > 0 ? ( <>

Sub-commands

This command has the following sub-commands

) : ( <> )}
{entry.cards.map((card) => ( <> ))}
); } function commandName(entry: CliCommandRenderable, command: string) { if (entry.parentCommand?.name) { return `${entry.parentCommand?.name} ${command}`; } else { return command; } }