Merge pull request #1714 from fntlnz/fix/linuxkit-push-help

Removed moby from the linuxkit's push help
This commit is contained in:
Riyaz Faizullabhoy 2017-04-26 15:11:46 -07:00 committed by GitHub
commit 326e46853c
8 changed files with 29 additions and 12 deletions

View File

@ -3,19 +3,21 @@ package main
import ( import (
"fmt" "fmt"
"os" "os"
"path/filepath"
log "github.com/Sirupsen/logrus" log "github.com/Sirupsen/logrus"
) )
func pushUsage() { func pushUsage() {
fmt.Printf("USAGE: %s push [backend] [options] [prefix]\n\n", os.Args[0]) invoked := filepath.Base(os.Args[0])
fmt.Printf("USAGE: %s push [backend] [options] [prefix]\n\n", invoked)
fmt.Printf("'backend' specifies the push backend.\n") fmt.Printf("'backend' specifies the push backend.\n")
fmt.Printf("Supported backends are\n") fmt.Printf("Supported backends are\n")
fmt.Printf(" gcp\n") fmt.Printf(" gcp\n")
fmt.Printf("\n") fmt.Printf("\n")
fmt.Printf("'options' are the backend specific options.\n") fmt.Printf("'options' are the backend specific options.\n")
fmt.Printf("See 'moby push [backend] --help' for details.\n\n") fmt.Printf("See '%s push [backend] --help' for details.\n\n", invoked)
fmt.Printf("'prefix' specifies the path to the VM image.\n") fmt.Printf("'prefix' specifies the path to the VM image.\n")
} }

View File

@ -4,6 +4,7 @@ import (
"flag" "flag"
"fmt" "fmt"
"os" "os"
"path/filepath"
"strings" "strings"
log "github.com/Sirupsen/logrus" log "github.com/Sirupsen/logrus"
@ -12,8 +13,9 @@ import (
// Process the run arguments and execute run // Process the run arguments and execute run
func pushGcp(args []string) { func pushGcp(args []string) {
gcpCmd := flag.NewFlagSet("gcp", flag.ExitOnError) gcpCmd := flag.NewFlagSet("gcp", flag.ExitOnError)
invoked := filepath.Base(os.Args[0])
gcpCmd.Usage = func() { gcpCmd.Usage = func() {
fmt.Printf("USAGE: %s push gcp [options] [name]\n\n", os.Args[0]) fmt.Printf("USAGE: %s push gcp [options] [name]\n\n", invoked)
fmt.Printf("'name' specifies the full path of an image file which will be uploaded\n") fmt.Printf("'name' specifies the full path of an image file which will be uploaded\n")
fmt.Printf("Options:\n\n") fmt.Printf("Options:\n\n")
gcpCmd.PrintDefaults() gcpCmd.PrintDefaults()

View File

@ -3,13 +3,15 @@ package main
import ( import (
"fmt" "fmt"
"os" "os"
"path/filepath"
"runtime" "runtime"
log "github.com/Sirupsen/logrus" log "github.com/Sirupsen/logrus"
) )
func runUsage() { func runUsage() {
fmt.Printf("USAGE: %s run [backend] [options] [prefix]\n\n", os.Args[0]) invoked := filepath.Base(os.Args[0])
fmt.Printf("USAGE: %s run [backend] [options] [prefix]\n\n", invoked)
fmt.Printf("'backend' specifies the run backend.\n") fmt.Printf("'backend' specifies the run backend.\n")
fmt.Printf("If not specified the platform specific default will be used\n") fmt.Printf("If not specified the platform specific default will be used\n")
@ -21,7 +23,7 @@ func runUsage() {
fmt.Printf(" packet\n") fmt.Printf(" packet\n")
fmt.Printf("\n") fmt.Printf("\n")
fmt.Printf("'options' are the backend specific options.\n") fmt.Printf("'options' are the backend specific options.\n")
fmt.Printf("See 'linuxkit run [backend] --help' for details.\n\n") fmt.Printf("See '%s run [backend] --help' for details.\n\n", invoked)
fmt.Printf("'prefix' specifies the path to the VM image.\n") fmt.Printf("'prefix' specifies the path to the VM image.\n")
fmt.Printf("It defaults to './image'.\n") fmt.Printf("It defaults to './image'.\n")
} }

View File

@ -4,6 +4,7 @@ import (
"flag" "flag"
"fmt" "fmt"
"os" "os"
"path/filepath"
log "github.com/Sirupsen/logrus" log "github.com/Sirupsen/logrus"
) )
@ -27,8 +28,9 @@ const (
// Process the run arguments and execute run // Process the run arguments and execute run
func runGcp(args []string) { func runGcp(args []string) {
gcpCmd := flag.NewFlagSet("gcp", flag.ExitOnError) gcpCmd := flag.NewFlagSet("gcp", flag.ExitOnError)
invoked := filepath.Base(os.Args[0])
gcpCmd.Usage = func() { gcpCmd.Usage = func() {
fmt.Printf("USAGE: %s run gcp [options] [name]\n\n", os.Args[0]) fmt.Printf("USAGE: %s run gcp [options] [name]\n\n", invoked)
fmt.Printf("'name' specifies either the name of an already uploaded\n") fmt.Printf("'name' specifies either the name of an already uploaded\n")
fmt.Printf("GCP image or the full path to a image file which will be\n") fmt.Printf("GCP image or the full path to a image file which will be\n")
fmt.Printf("uploaded before it is run.\n\n") fmt.Printf("uploaded before it is run.\n\n")

View File

@ -6,6 +6,7 @@ import (
"io/ioutil" "io/ioutil"
"net" "net"
"os" "os"
"path/filepath"
log "github.com/Sirupsen/logrus" log "github.com/Sirupsen/logrus"
"github.com/moby/hyperkit/go" "github.com/moby/hyperkit/go"
@ -16,8 +17,9 @@ import (
// Process the run arguments and execute run // Process the run arguments and execute run
func runHyperKit(args []string) { func runHyperKit(args []string) {
hyperkitCmd := flag.NewFlagSet("hyperkit", flag.ExitOnError) hyperkitCmd := flag.NewFlagSet("hyperkit", flag.ExitOnError)
invoked := filepath.Base(os.Args[0])
hyperkitCmd.Usage = func() { hyperkitCmd.Usage = func() {
fmt.Printf("USAGE: %s run hyperkit [options] prefix\n\n", os.Args[0]) fmt.Printf("USAGE: %s run hyperkit [options] prefix\n\n", invoked)
fmt.Printf("'prefix' specifies the path to the VM image.\n") fmt.Printf("'prefix' specifies the path to the VM image.\n")
fmt.Printf("\n") fmt.Printf("\n")
fmt.Printf("Options:\n") fmt.Printf("Options:\n")

View File

@ -4,10 +4,12 @@ import (
"encoding/json" "encoding/json"
"flag" "flag"
"fmt" "fmt"
log "github.com/Sirupsen/logrus"
"github.com/packethost/packngo"
"net/http" "net/http"
"os" "os"
"path/filepath"
log "github.com/Sirupsen/logrus"
"github.com/packethost/packngo"
) )
const ( const (
@ -39,8 +41,9 @@ func ValidateHTTPURL(url string) {
// Process the run arguments and execute run // Process the run arguments and execute run
func runPacket(args []string) { func runPacket(args []string) {
packetCmd := flag.NewFlagSet("packet", flag.ExitOnError) packetCmd := flag.NewFlagSet("packet", flag.ExitOnError)
invoked := filepath.Base(os.Args[0])
packetCmd.Usage = func() { packetCmd.Usage = func() {
fmt.Printf("USAGE: %s run packet [options] [name]\n\n", os.Args[0]) fmt.Printf("USAGE: %s run packet [options] [name]\n\n", invoked)
fmt.Printf("Options:\n\n") fmt.Printf("Options:\n\n")
packetCmd.PrintDefaults() packetCmd.PrintDefaults()
} }

View File

@ -6,6 +6,7 @@ import (
"io/ioutil" "io/ioutil"
"os" "os"
"os/exec" "os/exec"
"path/filepath"
log "github.com/Sirupsen/logrus" log "github.com/Sirupsen/logrus"
) )
@ -33,9 +34,10 @@ type QemuConfig struct {
} }
func runQemu(args []string) { func runQemu(args []string) {
invoked := filepath.Base(os.Args[0])
qemuFlags := flag.NewFlagSet("qemu", flag.ExitOnError) qemuFlags := flag.NewFlagSet("qemu", flag.ExitOnError)
qemuFlags.Usage = func() { qemuFlags.Usage = func() {
fmt.Printf("USAGE: %s run qemu [options] prefix\n\n", os.Args[0]) fmt.Printf("USAGE: %s run qemu [options] prefix\n\n", invoked)
fmt.Printf("'prefix' specifies the path to the VM image.\n") fmt.Printf("'prefix' specifies the path to the VM image.\n")
fmt.Printf("\n") fmt.Printf("\n")
fmt.Printf("Options:\n") fmt.Printf("Options:\n")

View File

@ -6,6 +6,7 @@ import (
"io/ioutil" "io/ioutil"
"os" "os"
"os/exec" "os/exec"
"path/filepath"
"runtime" "runtime"
log "github.com/Sirupsen/logrus" log "github.com/Sirupsen/logrus"
@ -58,9 +59,10 @@ guestOS = "other3xlinux-64"
` `
func runVMware(args []string) { func runVMware(args []string) {
invoked := filepath.Base(os.Args[0])
vmwareArgs := flag.NewFlagSet("vmware", flag.ExitOnError) vmwareArgs := flag.NewFlagSet("vmware", flag.ExitOnError)
vmwareArgs.Usage = func() { vmwareArgs.Usage = func() {
fmt.Printf("USAGE: %s run vmware [options] prefix\n\n", os.Args[0]) fmt.Printf("USAGE: %s run vmware [options] prefix\n\n", invoked)
fmt.Printf("'prefix' specifies the path to the VM image.\n") fmt.Printf("'prefix' specifies the path to the VM image.\n")
fmt.Printf("\n") fmt.Printf("\n")
fmt.Printf("Options:\n") fmt.Printf("Options:\n")