Fix broken native command line argument support (#23312)

This commit is contained in:
Cheena Malhotra
2023-06-07 00:37:49 -07:00
committed by GitHub
parent 9b94f82b2e
commit a1ab537094
4 changed files with 112 additions and 83 deletions

View File

@@ -7,7 +7,15 @@
* A list of command line arguments we support natively.
*/
export interface NativeParsedArgs {
_: string[];
/**
* {{ SQL CARBON EDIT}} Start
* Optional for Azure Data Studio to support URI conversion.
* Used to determine file paths to be opened with SQL Editor.
* If provided, we connect the given profile to to it.
* More than one files can be passed to connect to provided profile.
*/
_?: string[];
/** {{ SQL CARBON EDIT}} End */
'folder-uri'?: string[]; // undefined or array of 1 or more
'file-uri'?: string[]; // undefined or array of 1 or more
_urls?: string[];
@@ -93,12 +101,55 @@ export interface NativeParsedArgs {
'locate-shell-integration-path'?: string;
// {{SQL CARBON EDIT}} Start
/**
* Deprecated - used by SSMS - authenticationType should be used instead
*/
aad?: boolean;
database?: string;
integrated?: boolean;
server?: string;
user?: string;
/**
* Supports providing applicationName that will be used for connection profile app name.
*/
applicationName?: string;
/**
* Provide authenticationType to be used.
* accepted values: AzureMFA, SqlLogin, Integrated, etc.
*/
authenticationType?: string
/**
* Operation to perform:
* accepted values: connect, openConnectionDialog
*/
command?: string;
/**
* Supports providing advanced connection properties that providers support.
* Value must be a json object containing key-value pairs in format: '{"key1":"value1","key2":"value2",...}'
*/
connectionProperties?: string;
/**
* Name of database
*/
database?: string;
/**
* Deprecated - used by SSMS - authenticationType should be used instead.
*/
integrated?: boolean;
/**
* Name of connection provider,
* accepted values: mssql (by default), pgsql, etc.
*/
provider?: string;
/**
* Name of server
*/
server?: string;
/**
* Whether or not to show dashboard
* accepted values: true, false (by default).
*/
showDashboard?: boolean;
/**
* User name/email address
*/
user?: string;
// {{SQL CARBON EDIT}} End
// chromium command line args: https://electronjs.org/docs/all#supported-chrome-command-line-switches

View File

@@ -131,12 +131,17 @@ export const OPTIONS: OptionDescriptions<Required<NativeParsedArgs>> = {
'locate-shell-integration-path': { type: 'string', args: ['bash', 'pwsh', 'zsh'] },
// {{SQL CARBON EDIT}} Start
'command': { type: 'string', alias: 'c', cat: 'o', args: 'command-name', description: localize('commandParameter', 'Name of command to run') },
'database': { type: 'string', alias: 'D', cat: 'o', args: 'database', description: localize('databaseParameter', 'Database name') },
'server': { type: 'string', alias: 'S', cat: 'o', args: 'server', description: localize('serverParameter', 'Server name') },
'user': { type: 'string', alias: 'U', cat: 'o', args: 'user-name', description: localize('userParameter', 'User name for server connection') },
'aad': { type: 'boolean', cat: 'o', description: localize('aadParameter', 'Use Azure Active Directory authentication for server connection') },
'integrated': { type: 'boolean', alias: 'E', cat: 'o', description: localize('integratedAuthParameter', 'Use Integrated authentication for server connection') },
'aad': { type: 'boolean', cat: 'o', description: localize('aadParameter', 'Use Azure Active Directory authentication, this option is depcrecated - use \'authenticationType\' instead.') },
'applicationName': { type: 'string', alias: 'A', cat: 'o', allowEmptyValue: true, description: localize('applicationNameParameter', 'Supports providing applicationName that will be used for connection profile app name.') },
'authenticationType': { type: 'string', alias: 'T', cat: 'o', allowEmptyValue: true, deprecates: ['aad', 'integrated'], description: localize('authenticationTypeParameter', 'Provide authentication mode to be used. Accepted values: AzureMFA, SqlLogin, Integrated, etc.') },
'command': { type: 'string', alias: 'c', cat: 'o', args: 'command-name', allowEmptyValue: true, description: localize('commandParameter', 'Name of command to run, accepted values: connect, openConnectionDialog') },
'connectionProperties': { type: 'string', alias: 'Z', cat: 'o', allowEmptyValue: true, description: localize('connectionPropsParameter', `Supports providing advanced connection properties that providers support. Value must be a json object containing key-value pairs in format: '{"key1":"value1"}'`) },
'database': { type: 'string', alias: 'D', cat: 'o', args: 'database', allowEmptyValue: true, description: localize('databaseParameter', 'Name of database') },
'integrated': { type: 'boolean', alias: 'E', cat: 'o', description: localize('integratedAuthParameter', 'Use Integrated authentication, this option is depcrecated - use \'authenticationType\' instead.') },
'provider': { type: 'string', alias: 'P', cat: 'o', allowEmptyValue: true, description: localize('providerParameter', 'Connection provider to use, e.g. MSSQL, PGSQL, etc. ') },
'server': { type: 'string', alias: 'S', cat: 'o', args: 'server', allowEmptyValue: true, description: localize('serverParameter', 'Name of target server or host name.') },
'showDashboard': { type: 'boolean', cat: 'o', description: localize('showDashboardParameter', 'Whether or not to show dashboard on connection, false by default.') },
'user': { type: 'string', alias: 'U', cat: 'o', args: 'user-name', allowEmptyValue: true, description: localize('userParameter', 'User name/email address') },
// {{SQL CARBON EDIT}} - End
// chromium flags