Options which can be reused between different Zowe commands

### Hierarchy

- SharedOptions

## Index

### Methods

- readStdin
- readStdinIfRequested

## Methods

### Static Private readStdin

- readStdin(args: Arguments, response: CommandResponse, commandType: ICommandNodeType, stream?: ReadStream & { fd: 0 }, done: (readErr: IImperativeError, attemptedStdinRead: boolean) => void): void

- - Defined in @zowe/imperative/src/cmd/src/utils/SharedOptions.ts:58

  Read from standard in until EOF (if the option was specified)

  #### Parameters

  - ##### args: Arguments

    arguments for the command

  - ##### response: CommandResponse

    the response object to write to / log to if necessary

  - ##### commandType: ICommandNodeType

    what type of command might have the --stdin option? If it's not "command" this method will return immediately

  - ##### Default value stream: ReadStream & { fd: 0 } = process.stdin

  - ##### done: (readErr: IImperativeError, attemptedStdinRead: boolean) => void

    callback for when stdin reading is done. attemptedStdinRead: whether we tried to read standard in based on the arguments and command definition

    - - (readErr: IImperativeError, attemptedStdinRead: boolean): void

      - #### Parameters

        - ##### readErr: IImperativeError

        - ##### attemptedStdinRead: boolean

        #### Returns void

### Static readStdinIfRequested

- readStdinIfRequested(args: Arguments, response: CommandResponse, commandType: ICommandNodeType, stream?: ReadStream & { fd: 0 }): Promise<boolean>

- - Defined in @zowe/imperative/src/cmd/src/utils/SharedOptions.ts:33

  Promise based API for reading the standard in if the arguments dictate to do so. The response is placed in the arguments to be passed on the the command handlers.

  memberof

    SharedOptions

  #### Parameters

  - ##### args: Arguments

    The yargs style command line arguments supplied by the user

  - ##### response: CommandResponse

    The command response object (for messages, etc.)

  - ##### commandType: ICommandNodeType

    The type of the command

  - ##### Default value stream: ReadStream & { fd: 0 } = process.stdin

  #### Returns Promise<boolean>

  - The promise to be fulfilled (or rejected with an imperative error) - false if

                                stdin was read and false if it wasn't

Generated using TypeDoc