Package cli

Class CLIView

java.lang.Object
cli.CLIView
All Implemented Interfaces:
CLI

public class CLIView extends Object implements CLI
Handles the view task CLI parameters.

This class defines the command-line options and validation logic for the view task. See options() for details.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    The content type to view.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The content type specified by the user.
    final Path
    The path to the input storage file.
    final Path
    The path to the output destination.
    final Set<String>
    The set of query filters provided by the user.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CLIView(org.apache.commons.cli.CommandLine arguments)
    Constructs a CLIView instance by parsing the provided command-line arguments.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.commons.cli.Options
    Defines the command-line options for the view task.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • input

      public final Path input
      The path to the input storage file.
    • content

      public final CLIView.Content content
      The content type specified by the user.
    • output

      public final Path output
      The path to the output destination.
    • query

      public final Set<String> query
      The set of query filters provided by the user.
  • Constructor Details

    • CLIView

      public CLIView(org.apache.commons.cli.CommandLine arguments) throws MusialException
      Constructs a CLIView instance by parsing the provided command-line arguments.

      This constructor validates and extracts the input storage file path, content type, output destination, and query filters from the provided CommandLine arguments.

      Parameters:
      arguments - The CommandLine object containing the parsed arguments.
      Throws:
      MusialException - If an error occurs while parsing the arguments.
  • Method Details

    • options

      public static org.apache.commons.cli.Options options()
      Defines the command-line options for the view task.

      The options include:

      • -I, --storage: Path to the input storage file (required).
      • -C, --content: The content type to view (FEATURES, SAMPLES, VARIANTS) (required).
      • -q, --query: One or more identifiers or genomic ranges to query (optional).
      • -o, --output: Path to the output file or a special value ("print" or "stdout") (optional).
      Returns:
      An Options object containing the defined CLI options.