Skip to content

Commit

Permalink
Added logout, login to help message
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobMGEvans committed Mar 25, 2022
1 parent 52ea60f commit bb8c073
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/forty-kiwis-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

polish: added logout and login to helpstring message.
16 changes: 12 additions & 4 deletions packages/wrangler/src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ describe("wrangler", () => {
it("should display a list of available commands", async () => {
await runWrangler();

expect(std.out).toMatchInlineSnapshot(`
expect(std.out).toMatchInlineSnapshot(
`
"wrangler
Commands:
wrangler init [name] 📥 Create a wrangler.toml configuration file
wrangler login 🔓 Login to Cloudflare
wrangler logout 🚪 Logout from Cloudflare
wrangler whoami 🕵️ Retrieve your user info and test your auth config
wrangler dev [script] 👂 Start a local server for developing your worker
wrangler publish [script] 🆙 Publish your Worker to Cloudflare.
Expand All @@ -52,7 +55,8 @@ describe("wrangler", () => {
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
--legacy-env Use legacy environments [boolean]"
`);
`
);

expect(std.err).toMatchInlineSnapshot(`""`);
});
Expand All @@ -67,11 +71,14 @@ describe("wrangler", () => {
);

expect(std.out).toMatchInlineSnapshot(`""`);
expect(std.err).toMatchInlineSnapshot(`
expect(std.err).toMatchInlineSnapshot(
`
"wrangler
Commands:
wrangler init [name] 📥 Create a wrangler.toml configuration file
wrangler login 🔓 Login to Cloudflare
wrangler logout 🚪 Logout from Cloudflare
wrangler whoami 🕵️ Retrieve your user info and test your auth config
wrangler dev [script] 👂 Start a local server for developing your worker
wrangler publish [script] 🆙 Publish your Worker to Cloudflare.
Expand All @@ -90,7 +97,8 @@ describe("wrangler", () => {
--legacy-env Use legacy environments [boolean]
Unknown command: invalid-command."
`);
`
);
});
});

Expand Down
6 changes: 2 additions & 4 deletions packages/wrangler/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -620,8 +620,7 @@ export async function main(argv: string[]): Promise<void> {
wrangler.command(
// this needs scopes as an option?
"login",
false, // we don't need to show this in the menu
// "🔓 Login to Cloudflare",
"🔓 Login to Cloudflare",
(yargs) => {
// TODO: This needs some copy editing
// I mean, this entire app does, but this too.
Expand Down Expand Up @@ -669,8 +668,7 @@ export async function main(argv: string[]): Promise<void> {
wrangler.command(
// this needs scopes as an option?
"logout",
false, // we don't need to show this in the menu
// "🚪 Logout from Cloudflare",
"🚪 Logout from Cloudflare",
() => {},
async () => {
printWranglerBanner();
Expand Down

0 comments on commit bb8c073

Please sign in to comment.