github.com/zignig/go-ipfs@v0.0.0-20141111235910-c9e5fdf55a52/cmd/ipfs/update.go (about)

     1  package main
     2  
     3  import (
     4  	flag "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag"
     5  	commander "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander"
     6  	"github.com/jbenet/go-ipfs/core/commands"
     7  )
     8  
     9  func init() {
    10  	cmdIpfsUpdate.Flag.Bool("force", false, "force shutdown of daemon when updating")
    11  }
    12  
    13  var cmdIpfsUpdate = &commander.Command{
    14  	UsageLine: "update",
    15  	Short:     "check for updates and apply them",
    16  	Long: `ipfs update - check for updates and apply them
    17  
    18  		ipfs update <version>  - apply
    19  		ipfs update check      - just check
    20  		ipfs update log        - list the changelogs
    21  
    22  ipfs update is a utility command used to check for updates and apply them.
    23  I wont even try, @jbenet. You do this much better :)`,
    24  	Run: makeCommand(command{
    25  		name:   "updateApply",
    26  		args:   0,
    27  		flags:  []string{"force"},
    28  		online: true,
    29  		cmdFn:  commands.UpdateApply,
    30  	}),
    31  	Subcommands: []*commander.Command{
    32  		cmdIpfsUpdateCheck,
    33  		cmdIpfsUpdateLog,
    34  	},
    35  	Flag: *flag.NewFlagSet("ipfs-update", flag.ExitOnError),
    36  }
    37  
    38  var cmdIpfsUpdateCheck = &commander.Command{
    39  	UsageLine: "check",
    40  	Short:     "",
    41  	Long:      `ipfs update check <key>`,
    42  	Run: makeCommand(command{
    43  		name:   "updateCheck",
    44  		args:   0,
    45  		flags:  nil,
    46  		online: false,
    47  		cmdFn:  commands.UpdateCheck,
    48  	}),
    49  }
    50  
    51  var cmdIpfsUpdateLog = &commander.Command{
    52  	UsageLine: "log",
    53  	Short:     "list the last versions and their changelog",
    54  	Long:      `ipfs updage log - list the last versions and their changelog`,
    55  	Run: makeCommand(command{
    56  		name:   "updateLog",
    57  		args:   0,
    58  		flags:  nil,
    59  		online: false,
    60  		cmdFn:  commands.UpdateCheck,
    61  	}),
    62  }