-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use sfdx's apiversion and loglevel flags
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (c) 2020, salesforce.com, inc. | ||
* All rights reserved. | ||
* Licensed under the BSD 3-Clause license. | ||
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
|
||
import { Flags } from '@oclif/core'; | ||
import { Messages } from '@salesforce/core'; | ||
import { orgApiVersionFlag } from './flags/orgApiVersion'; | ||
|
||
/** | ||
* Adds an alias for the deprecated sfdx-style "apiversion" and provides a warning if it is used | ||
* See orgApiVersionFlag for full details | ||
* | ||
* @deprecated | ||
* @example | ||
* ``` | ||
* import { Flags } from '@salesforce/sf-plugins-core'; | ||
* public static flags = { | ||
* 'api-version': Flags.orgApiVersion({ | ||
* char: 'a', | ||
* description: 'api version for the org' | ||
* }), | ||
* } | ||
* ``` | ||
*/ | ||
export const orgApiVersionFlagWithDeprecations = orgApiVersionFlag({ | ||
aliases: ['apiversion'], | ||
deprecateAliases: true, | ||
}); | ||
|
||
Messages.importMessagesDirectory(__dirname); | ||
const messages = Messages.loadMessages('@salesforce/sf-plugins-core', 'messages'); | ||
/** | ||
* Use only for commands that maintain sfdx compatibility. | ||
* Flag will be hidden and will show a warning if used. | ||
* Flag does *not* set the loglevel | ||
* | ||
* @deprecated | ||
* | ||
*/ | ||
export const loglevel = Flags.string({ | ||
hidden: true, | ||
deprecated: { | ||
message: messages.getMessage('warning.loglevel'), | ||
}, | ||
}); |