Skip to content

Commit

Permalink
Merge pull request #73 from tiktok/feat-no-profile-help
Browse files Browse the repository at this point in the history
Feat no profile help
  • Loading branch information
chengcyber authored May 24, 2024
2 parents 08a6647 + 0a6f985 commit 804fab0
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 9 deletions.
21 changes: 17 additions & 4 deletions apps/sparo-lib/src/cli/commands/checkout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,23 @@ export class CheckoutCommand implements ICommand<ICheckoutCommandOptions> {
description:
'Create a new branch and start it at <start-point>; if it already exists, reset it to <start-point>'
})
.array('profile')
.default('profile', [])
.array('add-profile')
.default('add-profile', [])
.option('profile', {
describe:
'Checkout projects by specified profile(s). The profiles will be recorded and reused by other sparo commands. For example, running "sparo checkout <branch>" sparse checkout based on the reused profiles after running "git checkout"',
default: [],
type: 'array'
})
.option('add-profile', {
describe:
'Checkout projects with recorded profile(s) and the specified added profile(s). Adds the specified added profile(s) to sparo recorded profiles',
default: [],
type: 'array'
})
.option('no-profile', {
hidden: false,
describe: 'Checkout projects without any profiles and clear all recorded profiles',
type: 'boolean'
})
.option('to', {
type: 'array',
default: [],
Expand Down
14 changes: 11 additions & 3 deletions apps/website/docs/pages/commands/sparo_checkout.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,20 @@ Positionals:
start-point [string]
Options:
-h, --help Show help [boolean]
--help Show help [boolean]
-b Create a new branch and start it at <start-point> [boolean]
-B Create a new branch and start it at <start-point>; if it
already exists, reset it to <start-point> [boolean]
--profile [array] [default: []]
--add-profile [array] [default: []]
--profile Checkout projects by specified profile(s). The profiles
will be recorded and reused by other sparo commands. For
example, running "sparo checkout <branch>" sparse checkout
based on the reused profiles after running "git checkout"
[array] [default: []]
--add-profile Checkout projects with recorded profile(s) and the
specified added profile(s). Adds the specified added
profile(s) to sparo recorded profiles [array] [default: []]
--no-profile Checkout projects without any profiles and clear all
recorded profiles [boolean]
--to Checkout projects up to (and including) project <to..>, can
be used together with option --profile/--add-profile to
form a union selection of the two options. The projects
Expand Down
12 changes: 10 additions & 2 deletions build-tests/sparo-output-test/etc/checkout-help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ Options:
-b Create a new branch and start it at <start-point> [boolean]
-B Create a new branch and start it at <start-point>; if it
already exists, reset it to <start-point> [boolean]
--profile Checkout projects by specified profile(s). The profiles
will be recorded and reused by other sparo commands. For
example, running "sparo checkout <branch>" sparse checkout
based on the reused profiles after running "git checkout"
[array] [default: []]
--add-profile Checkout projects with recorded profile(s) and the
specified added profile(s). Adds the specified added
profile(s) to sparo recorded profiles [array] [default: []]
--no-profile Checkout projects without any profiles and clear all
recorded profiles [boolean]
--to Checkout projects up to (and including) project <to..>, can
be used together with option --profile/--add-profile to
form a union selection of the two options. The projects
Expand All @@ -30,5 +40,3 @@ Options:
union selection of the two options. The projects selectors
here will never replace what have been checked out by
profiles [array] [default: []]
--profile [array] [default: []]
--add-profile [array] [default: []]
10 changes: 10 additions & 0 deletions common/changes/sparo/feat-no-profile-help_2024-05-24-21-14.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "sparo",
"comment": "Improve \"sparo checkout\" help text for \"--profile\", \"--add-profile\" and \"--no-profile\" paramters",
"type": "none"
}
],
"packageName": "sparo"
}

0 comments on commit 804fab0

Please sign in to comment.