Commit 5fa3053e authored by Henry's avatar Henry

added command stubs

parent ee8bcd55
......@@ -68,6 +68,7 @@ Use "ipfs help <command>" for more information about a command.
cmdIpfsDiag,
cmdIpfsBlock,
cmdIpfsObject,
cmdIpfsUpdate,
cmdIpfsLog,
cmdIpfsPin,
},
......
package main
import (
flag "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag"
commander "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander"
"github.com/jbenet/go-ipfs/core/commands"
)
var cmdIpfsUpdate = &commander.Command{
UsageLine: "update",
Short: "check for updates and apply them",
Long: `ipfs update - check for updates and apply them
ipfs update <version> - apply
ipfs update check - just check
ipfs update log - list the changelogs
ipfs update is a utility command used to check for updates and apply them.
I wont even try, @jbenet. You do this much better :)`,
Run: makeCommand(command{
name: "updateApply",
args: 0,
flags: nil,
online: true,
cmdFn: commands.UpdateApply,
}),
Subcommands: []*commander.Command{
cmdIpfsUpdateCheck,
cmdIpfsUpdateLog,
},
Flag: *flag.NewFlagSet("ipfs-update", flag.ExitOnError),
}
var cmdIpfsUpdateCheck = &commander.Command{
UsageLine: "check",
Short: "",
Long: `ipfs update check <key>`,
Run: makeCommand(command{
name: "updateCheck",
args: 0,
flags: nil,
online: false,
cmdFn: commands.UpdateCheck,
}),
}
var cmdIpfsUpdateLog = &commander.Command{
UsageLine: "log",
Short: "list the last versions and their changelog",
Long: `ipfs updage log - list the last versions and their changelog`,
Run: makeCommand(command{
name: "updateLog",
args: 0,
flags: nil,
online: false,
cmdFn: commands.UpdateCheck,
}),
}
package commands
import (
"errors"
"io"
"github.com/jbenet/go-ipfs/core"
)
// UpdateApply applys an update of the ipfs binary and shuts down the node if successful
func UpdateApply(n *core.IpfsNode, args []string, opts map[string]interface{}, out io.Writer) error {
return errors.New("TODOUpdateApply")
}
// UpdateCheck checks wether there is an update available
func UpdateCheck(n *core.IpfsNode, args []string, opts map[string]interface{}, out io.Writer) error {
return errors.New("TODOUpdateCheck")
}
func UpdateLog(n *core.IpfsNode, args []string, opts map[string]interface{}, out io.Writer) error {
return errors.New("TODOUpdateLog")
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment