Skip to content

Commit

Permalink
style(cli): Change all help messages to lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedBassem committed Apr 24, 2024
1 parent 3352a3e commit ac2f78f
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion apps/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@hoarderapp/cli",
"version": "0.12.1",
"version": "0.12.2",
"description": "Command Line Interface (CLI) for Hoarder",
"license": "GNU Affero General Public License version 3",
"keywords": [
Expand Down
24 changes: 12 additions & 12 deletions apps/cli/src/commands/bookmarks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { ZBookmark } from "@hoarder/shared/types/bookmarks";

export const bookmarkCmd = new Command()
.name("bookmarks")
.description("Manipulating bookmarks");
.description("manipulating bookmarks");

function collect<T>(val: T, acc: T[]) {
acc.push(val);
Expand All @@ -31,7 +31,7 @@ function normalizeBookmark(bookmark: ZBookmark) {

bookmarkCmd
.command("add")
.description("Creates a new bookmark")
.description("creates a new bookmark")
.option(
"--link <link>",
"the link to add. Specify multiple times to add multiple links",
Expand Down Expand Up @@ -87,14 +87,14 @@ bookmarkCmd

bookmarkCmd
.command("update")
.description("Archive a bookmark")
.option("--title <title>", "If set, the bookmark's title will be updated")
.option("--note <note>", "If set, the bookmark's note will be updated")
.option("--archive", "If set, the bookmark will be archived")
.option("--no-archive", "If set, the bookmark will be unarchived")
.option("--favourite", "If set, the bookmark will be favourited")
.option("--no-favourite", "If set, the bookmark will be unfavourited")
.argument("<id>", "The id of the bookmark to get")
.description("update a bookmark")
.option("--title <title>", "if set, the bookmark's title will be updated")
.option("--note <note>", "if set, the bookmark's note will be updated")
.option("--archive", "if set, the bookmark will be archived")
.option("--no-archive", "if set, the bookmark will be unarchived")
.option("--favourite", "if set, the bookmark will be favourited")
.option("--no-favourite", "if set, the bookmark will be unfavourited")
.argument("<id>", "the id of the bookmark to get")
.action(async (id, opts) => {
const api = getAPIClient();
const resp = await api.bookmarks.updateBookmark.mutate({
Expand All @@ -114,7 +114,7 @@ bookmarkCmd
"If set, archived bookmarks will be fetched as well",
false,
)
.option("--list-id <id>", "If set, only items from that list will be fetched")
.option("--list-id <id>", "if set, only items from that list will be fetched")
.action(async (opts) => {
const api = getAPIClient();
const resp = await api.bookmarks.getBookmarks.query({
Expand All @@ -127,7 +127,7 @@ bookmarkCmd
bookmarkCmd
.command("delete")
.description("delete a bookmark")
.argument("<id>", "The id of the bookmark to delete")
.argument("<id>", "the id of the bookmark to delete")
.action(async (id) => {
const api = getAPIClient();
await api.bookmarks.deleteBookmark.mutate({ bookmarkId: id });
Expand Down
20 changes: 10 additions & 10 deletions apps/cli/src/commands/lists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { listsToTree } from "@hoarder/shared/utils/listUtils";

export const listsCmd = new Command()
.name("lists")
.description("Manipulating lists");
.description("manipulating lists");

listsCmd
.command("list")
.description("Lists all lists")
.description("lists all lists")
.action(async () => {
const api = getAPIClient();

Expand All @@ -31,8 +31,8 @@ listsCmd

listsCmd
.command("delete")
.description("Deletes a list")
.argument("<id>", "The id of the list")
.description("deletes a list")
.argument("<id>", "the id of the list")
.action(async (id) => {
const api = getAPIClient();

Expand All @@ -44,9 +44,9 @@ listsCmd

listsCmd
.command("add-bookmark")
.description("Add a bookmark to list")
.requiredOption("--list <id>", "The id of the list")
.requiredOption("--bookmark <bookmark>", "The id of the bookmark")
.description("add a bookmark to list")
.requiredOption("--list <id>", "the id of the list")
.requiredOption("--bookmark <bookmark>", "the id of the bookmark")
.action(async (opts) => {
const api = getAPIClient();

Expand All @@ -59,9 +59,9 @@ listsCmd

listsCmd
.command("remove-bookmark")
.description("Remove a bookmark from list")
.requiredOption("--list <id>", "The id of the list")
.requiredOption("--bookmark <bookmark>", "The id of the bookmark")
.description("remove a bookmark from list")
.requiredOption("--list <id>", "the id of the list")
.requiredOption("--bookmark <bookmark>", "the id of the bookmark")
.action(async (opts) => {
const api = getAPIClient();

Expand Down
8 changes: 4 additions & 4 deletions apps/cli/src/commands/tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { getBorderCharacters, table } from "table";

export const tagsCmd = new Command()
.name("tags")
.description("Manipulating tags");
.description("manipulating tags");

tagsCmd
.command("list")
.description("Lists all tags")
.description("lists all tags")
.action(async () => {
const api = getAPIClient();

Expand All @@ -27,8 +27,8 @@ tagsCmd

tagsCmd
.command("delete")
.description("Delete a tag")
.argument("<id>", "The id of the tag")
.description("delete a tag")
.argument("<id>", "the id of the tag")
.action(async (id) => {
const api = getAPIClient();

Expand Down
8 changes: 4 additions & 4 deletions apps/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ import { setGlobalOptions } from "@/lib/globals";
import { Command, Option } from "@commander-js/extra-typings";

const program = new Command()
.name("hoarder-cli")
.name("hoarder")
.description("A CLI interface to interact with the hoarder api")
.addOption(
new Option("--api-key <key>", "The API key to interact with the API")
new Option("--api-key <key>", "the API key to interact with the API")
.makeOptionMandatory(true)
.env("HOARDER_API_KEY"),
)
.addOption(
new Option(
"--server-addr <addr>",
"The address of the server to connect to",
"the address of the server to connect to",
)
.makeOptionMandatory(true)
.env("HOARDER_SERVER_ADDR"),
)
.version(process.env.SERVER_VERSION ?? "nightly");
.version(process.env.npm_package_version ?? "0.0.0");

program.addCommand(bookmarkCmd);
program.addCommand(listsCmd);
Expand Down

0 comments on commit ac2f78f

Please sign in to comment.