Skip to content

Commit

Permalink
Prefer verbose names
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Mar 13, 2017
1 parent 7fc5fb1 commit 8419f43
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import * as os from 'os';
import { Terminal as BaseTerminal } from './terminal';
import { ITerminal, IPtyOpenOptions, IPtyForkOptions } from './interfaces';
import { ArgvOrCmdline } from './types';
import { ArgvOrCommandLine } from './types';

let Terminal: any;
if (os.platform() === 'win32') {
Expand All @@ -26,17 +26,17 @@ if (os.platform() === 'win32') {
* @see Parsing C++ Comamnd-Line Arguments https://msdn.microsoft.com/en-us/library/17w5ykft.aspx
* @see GetCommandLine https://msdn.microsoft.com/en-us/library/windows/desktop/ms683156.aspx
*/
export function spawn(file?: string, args?: ArgvOrCmdline, opt?: IPtyForkOptions): ITerminal {
export function spawn(file?: string, args?: ArgvOrCommandLine, opt?: IPtyForkOptions): ITerminal {
return new Terminal(file, args, opt);
};

/** @deprecated */
export function fork(file?: string, args?: ArgvOrCmdline, opt?: IPtyForkOptions): ITerminal {
export function fork(file?: string, args?: ArgvOrCommandLine, opt?: IPtyForkOptions): ITerminal {
return new Terminal(file, args, opt);
};

/** @deprecated */
export function createTerminal(file?: string, args?: ArgvOrCmdline, opt?: IPtyForkOptions): ITerminal {
export function createTerminal(file?: string, args?: ArgvOrCommandLine, opt?: IPtyForkOptions): ITerminal {
return new Terminal(file, args, opt);
};

Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
* Copyright (c) 2017, Daniel Imms (MIT License).
*/

export type ArgvOrCmdline = string[] | string;
export type ArgvOrCommandLine = string[] | string;
4 changes: 2 additions & 2 deletions src/unixTerminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as path from 'path';
import * as tty from 'tty';
import { Terminal } from './terminal';
import { ProcessEnv, IPtyForkOptions, IPtyOpenOptions } from './interfaces';
import { ArgvOrCmdline } from './types';
import { ArgvOrCommandLine } from './types';
import { assign } from './utils';

const pty = require(path.join('..', 'build', 'Release', 'pty.node'));
Expand All @@ -32,7 +32,7 @@ export class UnixTerminal extends Terminal {
private master: any;
private slave: any;

constructor(file?: string, args?: ArgvOrCmdline, opt?: IPtyForkOptions) {
constructor(file?: string, args?: ArgvOrCommandLine, opt?: IPtyForkOptions) {
super();

if (typeof args === 'string') {
Expand Down
12 changes: 6 additions & 6 deletions src/windowsPtyAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import * as net from 'net';
import * as path from 'path';
import { ArgvOrCmdline } from './types';
import { ArgvOrCommandLine } from './types';

const pty = require(path.join('..', 'build', 'Release', 'pty.node'));

Expand All @@ -32,7 +32,7 @@ export class WindowsPtyAgent {

constructor(
file: string,
args: ArgvOrCmdline,
args: ArgvOrCommandLine,
env: string[],
cwd: string,
cols: number,
Expand All @@ -43,10 +43,10 @@ export class WindowsPtyAgent {
cwd = path.resolve(cwd);

// Compose command line
const cmdline = argsToCommandLine(file, args);
const commandLine = argsToCommandLine(file, args);

// Open pty session.
const term = pty.startProcess(file, cmdline, env, cwd, cols, rows, debug);
const term = pty.startProcess(file, commandLine, env, cwd, cols, rows, debug);

// Terminal pid.
this._pid = term.pid;
Expand Down Expand Up @@ -90,7 +90,7 @@ export class WindowsPtyAgent {
// Convert argc/argv into a Win32 command-line following the escaping convention
// documented on MSDN (e.g. see CommandLineToArgvW documentation). Copied from
// winpty project.
export function argsToCommandLine(file: string, args: ArgvOrCmdline): string {
export function argsToCommandLine(file: string, args: ArgvOrCommandLine): string {
if (isCommandLine(args)) {
if (args.length === 0) {
return file;
Expand Down Expand Up @@ -137,7 +137,7 @@ export function argsToCommandLine(file: string, args: ArgvOrCmdline): string {
return result;
}

function isCommandLine(args: ArgvOrCmdline): args is string {
function isCommandLine(args: ArgvOrCommandLine): args is string {
return typeof args === 'string';
}

Expand Down
4 changes: 2 additions & 2 deletions src/windowsTerminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { inherits } from 'util';
import { Terminal } from './terminal';
import { WindowsPtyAgent } from './windowsPtyAgent';
import { IPtyForkOptions, IPtyOpenOptions } from './interfaces';
import { ArgvOrCmdline } from './types';
import { ArgvOrCommandLine } from './types';
import { assign } from './utils';

const DEFAULT_FILE = 'cmd.exe';
Expand All @@ -20,7 +20,7 @@ export class WindowsTerminal extends Terminal {
private deferreds: any[];
private agent: WindowsPtyAgent;

constructor(file?: string, args?: ArgvOrCmdline, opt?: IPtyForkOptions) {
constructor(file?: string, args?: ArgvOrCommandLine, opt?: IPtyForkOptions) {
super();

// Initialize arguments
Expand Down

0 comments on commit 8419f43

Please sign in to comment.