Skip to content

Commit e587222

Browse files
Merge pull request #856 from appwrite/refactor-singular-to-plural
refactor(cli): Changing commands from singular to plural when applicable
2 parents 7aaa344 + 768c4ed commit e587222

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

templates/cli/lib/commands/pull.js.twig

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,6 @@ const { paginate } = require("../paginate");
1313
const { questionsPullCollection, questionsPullFunctions } = require("../questions");
1414
const { success, log, actionRunner, commandDescriptions } = require("../parser");
1515

16-
const pull = new Command("pull")
17-
.description(commandDescriptions['pull'])
18-
.configureHelp({
19-
helpWidth: process.stdout.columns || 80
20-
})
21-
.action(actionRunner(async (_options, command) => {
22-
command.help();
23-
}));
24-
2516
const pullProject = async () => {
2617
try {
2718
let response = await projectsGet({
@@ -170,36 +161,42 @@ const pullMessagingTopic = async () => {
170161
success();
171162
}
172163

164+
const pull = new Command("pull")
165+
.description(commandDescriptions['pull'])
166+
.configureHelp({
167+
helpWidth: process.stdout.columns || 80
168+
});
169+
173170
pull
174171
.command("project")
175172
.description("Pulling your {{ spec.title|caseUcfirst }} project name")
176173
.action(actionRunner(pullProject));
177174

178175
pull
179-
.command("function")
176+
.command("functions")
180177
.description(`Pulling your {{ spec.title|caseUcfirst }} functions`)
181178
.option(`--all`, `Flag to pull all functions`)
182179
.action(actionRunner(pullFunctions));
183180

184181
pull
185-
.command("collection")
182+
.command("collections")
186183
.description("Pulling your {{ spec.title|caseUcfirst }} collections")
187184
.option(`--databaseId <databaseId>`, `Database ID`)
188185
.option(`--all`, `Flag to pull all databases`)
189186
.action(actionRunner(pullCollection))
190187

191188
pull
192-
.command("bucket")
189+
.command("buckets")
193190
.description("Pulling your {{ spec.title|caseUcfirst }} buckets")
194191
.action(actionRunner(pullBucket))
195192

196193
pull
197-
.command("team")
194+
.command("teams")
198195
.description("Pulling your {{ spec.title|caseUcfirst }} teams")
199196
.action(actionRunner(pullTeam))
200197

201198
pull
202-
.command("topic")
199+
.command("topics")
203200
.description("Initialise your Appwrite messaging topics")
204201
.action(actionRunner(pullMessagingTopic))
205202

templates/cli/lib/commands/push.js.twig

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,8 +1117,10 @@ const pushMessagingTopic = async ({ all, yes } = {}) => {
11171117
const push = new Command("push")
11181118
.alias('deploy')
11191119
.description(commandDescriptions['push'])
1120-
.option(`--all`, `Flag to push all resources`)
1121-
.option(`--yes`, `Flag to confirm all warnings`)
1120+
1121+
push
1122+
.command("all")
1123+
.description("Push all resource.")
11221124
.action(actionRunner(pushResources));
11231125

11241126
push
@@ -1127,7 +1129,7 @@ push
11271129
.action(actionRunner(pushProject));
11281130

11291131
push
1130-
.command("function")
1132+
.command("functions")
11311133
.description("Push functions in the current directory.")
11321134
.option(`--functionId <functionId>`, `Function ID`)
11331135
.option(`--all`, `Flag to push all functions`)
@@ -1136,28 +1138,28 @@ push
11361138
.action(actionRunner(pushFunction));
11371139

11381140
push
1139-
.command("collection")
1141+
.command("collections")
11401142
.description("Push collections in the current project.")
11411143
.option(`--all`, `Flag to push all collections`)
11421144
.option(`--yes`, `Flag to confirm all warnings`)
11431145
.action(actionRunner(pushCollection));
11441146

11451147
push
1146-
.command("bucket")
1148+
.command("buckets")
11471149
.description("Push buckets in the current project.")
11481150
.option(`--all`, `Flag to push all buckets`)
11491151
.option(`--yes`, `Flag to confirm all warnings`)
11501152
.action(actionRunner(pushBucket));
11511153

11521154
push
1153-
.command("team")
1155+
.command("teams")
11541156
.description("Push teams in the current project.")
11551157
.option(`--all`, `Flag to push all teams`)
11561158
.option(`--yes`, `Flag to confirm all warnings`)
11571159
.action(actionRunner(pushTeam));
11581160

11591161
push
1160-
.command("topic")
1162+
.command("topics")
11611163
.description("Push messaging topics in the current project.")
11621164
.option(`--all`, `Flag to deploy all topics`)
11631165
.option(`--yes`, `Flag to confirm all warnings`)

0 commit comments

Comments
 (0)