Skip to content

Commit 085987f

Browse files
jmozahfjl
authored andcommitted
cmd/swarm: manifest manipulation commands (#3645)
1 parent aaf9cfd commit 085987f

File tree

3 files changed

+423
-0
lines changed

3 files changed

+423
-0
lines changed

cmd/swarm/main.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,43 @@ The output of this command is supposed to be machine-readable.
154154
Prints the swarm hash of file or directory.
155155
`,
156156
},
157+
{
158+
Name: "manifest",
159+
Usage: "update a MANIFEST",
160+
ArgsUsage: "manifest COMMAND",
161+
Description: `
162+
Updates a MANIFEST by adding/removing/updating the hash of a path.
163+
`,
164+
Subcommands: []cli.Command{
165+
{
166+
Action: add,
167+
Name: "add",
168+
Usage: "add a new path to the manifest",
169+
ArgsUsage: "<MANIFEST> <path> <hash> [<content-type>]",
170+
Description: `
171+
Adds a new path to the manifest
172+
`,
173+
},
174+
{
175+
Action: update,
176+
Name: "update",
177+
Usage: "update the hash for an already existing path in the manifest",
178+
ArgsUsage: "<MANIFEST> <path> <newhash> [<newcontent-type>]",
179+
Description: `
180+
Update the hash for an already existing path in the manifest
181+
`,
182+
},
183+
{
184+
Action: remove,
185+
Name: "remove",
186+
Usage: "removes a path from the manifest",
187+
ArgsUsage: "<MANIFEST> <path>",
188+
Description: `
189+
Removes a path from the manifest
190+
`,
191+
},
192+
},
193+
},
157194
}
158195

159196
app.Flags = []cli.Flag{

0 commit comments

Comments
 (0)