commonOptions top-level property
Implementation
final List<Option> commonOptions = [
Option(
name: '-',
description: 'Read from stdin (e.g. \'ps aux | grep code | code -\')'
),
Option(
name: ['-d', '--diff'],
description: 'Compare two files with each other',
args: [
Arg(
name: 'file',
template: 'filepaths'
),
Arg(
name: 'file',
template: 'filepaths'
)
]
),
Option(
name: ['-m', '--merge'],
description: 'Perform a three-way merge by providing paths for two modified versions of a file, the common origin of both modified versions and the output file to save merge results',
args: [
Arg(
name: 'path1',
template: 'filepaths'
),
Arg(
name: 'path2',
template: 'filepaths'
),
Arg(
name: 'base',
template: 'filepaths'
),
Arg(
name: 'result',
template: 'filepaths'
)
]
),
Option(
name: ['-a', '--add'],
description: 'Add folder(s) to the last active window',
args: [
Arg(
name: 'folder',
template: 'folders',
isVariadic: true
)
]
),
Option(
name: ['-g', '--goto'],
description: 'Open a file at the path on the specified line and character position',
args: [
Arg(
name: 'file:line[:character]',
template: 'filepaths'
)
]
),
Option(
name: ['-n', '--new-window'],
description: 'Force to open a new window'
),
Option(
name: ['-r', '--reuse-window'],
description: 'Force to open a file or folder in an already opened window'
),
Option(
name: ['-w', '--wait'],
description: 'Wait for the files to be closed before returning'
),
Option(
name: '--locale',
description: 'The locale to use (e.g. en-US or zh-TW)',
args: [
Arg(
name: 'locale',
suggestions: [
FigSuggestion(
name: 'zh-CN',
icon: '🇨🇳',
description: 'Simplified Chinese'
),
FigSuggestion(
name: 'zh-TW',
icon: '🇹🇼',
description: 'Traditional Chinese'
),
FigSuggestion(
name: 'fr',
icon: '🇫🇷',
description: 'French'
),
FigSuggestion(
name: 'de',
icon: '🇩🇪',
description: 'German'
),
FigSuggestion(
name: 'it',
icon: '🇮🇹',
description: 'Italian'
),
FigSuggestion(
name: 'es',
icon: '🇪🇸',
description: 'Spanish'
),
FigSuggestion(
name: 'ja',
icon: '🇯🇵',
description: 'Japanese'
),
FigSuggestion(
name: 'ko',
icon: '🇰🇷',
description: 'Korean'
),
FigSuggestion(
name: 'ru',
icon: '🇷🇺',
description: 'Russian'
),
FigSuggestion(
name: 'bg',
icon: '🇧🇬',
description: 'Bulgarian'
),
FigSuggestion(
name: 'hu',
icon: 'ðŸ‡ðŸ‡º',
description: 'Hungarian'
),
FigSuggestion(
name: 'pt-br',
icon: '🇧🇷',
description: 'Portuguese (Brazil)'
),
FigSuggestion(
name: 'tr',
icon: '🇹🇷',
description: 'Turkish'
)
]
)
]
),
Option(
name: '--user-data-dir',
description: 'Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code',
args: [
Arg(
name: 'dir',
template: 'folders'
)
]
),
Option(
name: '--profile',
description: 'Opens the provided folder or workspace with the given profile and associates the profile with the workspace. If the profile does not exist, a new empty one is created. A folder or workspace must be provided for the profile to take effect',
args: [
Arg(
name: 'settingsProfileName'
)
]
),
Option(
name: ['-h', '--help'],
description: 'Print usage'
)
];