From ca8f0a7bf885fc7512c400ffdfd2febed57a07b8 Mon Sep 17 00:00:00 2001 From: Cheng Liu Date: Fri, 24 May 2024 14:13:40 -0700 Subject: [PATCH 1/3] feat: improve sparo checkout help text --- apps/sparo-lib/src/cli/commands/checkout.ts | 21 +++++++++++++++---- .../sparo-output-test/etc/checkout-help.txt | 12 +++++++++-- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/apps/sparo-lib/src/cli/commands/checkout.ts b/apps/sparo-lib/src/cli/commands/checkout.ts index f1f78d6..4d50677 100644 --- a/apps/sparo-lib/src/cli/commands/checkout.ts +++ b/apps/sparo-lib/src/cli/commands/checkout.ts @@ -70,10 +70,23 @@ export class CheckoutCommand implements ICommand { description: 'Create a new branch and start it at ; if it already exists, reset it to ' }) - .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 " 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: [], diff --git a/build-tests/sparo-output-test/etc/checkout-help.txt b/build-tests/sparo-output-test/etc/checkout-help.txt index 333768b..ebefe8d 100644 --- a/build-tests/sparo-output-test/etc/checkout-help.txt +++ b/build-tests/sparo-output-test/etc/checkout-help.txt @@ -19,6 +19,16 @@ Options: -b Create a new branch and start it at [boolean] -B Create a new branch and start it at ; if it already exists, reset it to [boolean] + --profile Checkout projects by specified profile(s). The profiles + will be recorded and reused by other sparo commands. For + example, running "sparo checkout " 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 , can be used together with option --profile/--add-profile to form a union selection of the two options. The projects @@ -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: []] From bf0040a513f872008a1e4c5f0b4d713299f40b8d Mon Sep 17 00:00:00 2001 From: Cheng Liu Date: Fri, 24 May 2024 14:14:17 -0700 Subject: [PATCH 2/3] chore: rush change --- .../sparo/feat-no-profile-help_2024-05-24-21-14.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/sparo/feat-no-profile-help_2024-05-24-21-14.json diff --git a/common/changes/sparo/feat-no-profile-help_2024-05-24-21-14.json b/common/changes/sparo/feat-no-profile-help_2024-05-24-21-14.json new file mode 100644 index 0000000..dfe528a --- /dev/null +++ b/common/changes/sparo/feat-no-profile-help_2024-05-24-21-14.json @@ -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" +} \ No newline at end of file From 0a6f985f0392246a68312d515b4557ad54ff7789 Mon Sep 17 00:00:00 2001 From: Cheng Liu Date: Fri, 24 May 2024 14:16:11 -0700 Subject: [PATCH 3/3] feat: update sparo checkout page --- apps/website/docs/pages/commands/sparo_checkout.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/website/docs/pages/commands/sparo_checkout.md b/apps/website/docs/pages/commands/sparo_checkout.md index 0ced130..984d679 100644 --- a/apps/website/docs/pages/commands/sparo_checkout.md +++ b/apps/website/docs/pages/commands/sparo_checkout.md @@ -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 [boolean] -B Create a new branch and start it at ; if it already exists, reset it to [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 " 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 , can be used together with option --profile/--add-profile to form a union selection of the two options. The projects