Skip to content

Cli

This is the CLI interface for sabre-vobject.

  • Full name: \Sabre\VObject\Cli

Properties

quiet

No output.

protected bool $quiet

showHelp

Help display.

protected bool $showHelp

format

Whether to spit out 'mimedir' or 'json' format.

protected string $format

pretty

JSON pretty print.

protected bool $pretty

inputPath

Source file.

protected string $inputPath

outputPath

Destination file.

protected string $outputPath

stdout

output stream.

protected resource $stdout

stdin

stdin.

protected resource $stdin

stderr

stderr.

protected resource $stderr

inputFormat

Input format (one of json or mimedir).

protected string $inputFormat

forgiving

Makes the parser less strict.

protected bool $forgiving

parser

protected $parser

Methods

main

Main function.

public main(array $argv): int

Parameters:

Parameter Type Description
$argv array

showHelp

Shows the help message.

protected showHelp(): mixed

validate

Validates a VObject file.

protected validate(\Sabre\VObject\Component $vObj): int

Parameters:

Parameter Type Description
$vObj \Sabre\VObject\Component

repair

Repairs a VObject file.

protected repair(\Sabre\VObject\Component $vObj): int

Parameters:

Parameter Type Description
$vObj \Sabre\VObject\Component

convert

Converts a vObject file to a new format.

protected convert(\Sabre\VObject\Component $vObj): int

Parameters:

Parameter Type Description
$vObj \Sabre\VObject\Component

color

Colorizes a file.

protected color(\Sabre\VObject\Component $vObj): mixed

Parameters:

Parameter Type Description
$vObj \Sabre\VObject\Component

colorize

Returns an ansi color string for a color name.

protected colorize(string $color, mixed $str, mixed $resetTo = 'default'): string

Parameters:

Parameter Type Description
$color string
$str mixed
$resetTo mixed

cWrite

Writes out a string in specific color.

protected cWrite(string $color, string $str): mixed

Parameters:

Parameter Type Description
$color string
$str string

serializeComponent

protected serializeComponent(\Sabre\VObject\Component $vObj): mixed

Parameters:

Parameter Type Description
$vObj \Sabre\VObject\Component

serializeProperty

Colorizes a property.

protected serializeProperty(\Sabre\VObject\Property $property): mixed

Parameters:

Parameter Type Description
$property \Sabre\VObject\Property

parseArguments

Parses the list of arguments.

protected parseArguments(array $argv): mixed

Parameters:

Parameter Type Description
$argv array

readInput

Reads the input file.

protected readInput(): \Sabre\VObject\Component

log

Sends a message to STDERR.

protected log(string $msg, mixed $color = 'default'): mixed

Parameters:

Parameter Type Description
$msg string
$color mixed


Automatically generated on 2025-03-18