Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli ux and verbiage cleanup #55

Merged
merged 4 commits into from
Nov 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions cmd/hauler/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ func New() *cobra.Command {
pf.StringVar(&ro.cacheDir, "cache", "", "Location of where to store cache data (defaults to XDG_CACHE_DIR/hauler)")

// Add subcommands
addGet(cmd)
addSave(cmd)
addLoad(cmd)
addServe(cmd)
addDownload(cmd)
addStore(cmd)

return cmd
Expand Down
26 changes: 26 additions & 0 deletions cmd/hauler/cli/download.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package cli

import (
"github.com/spf13/cobra"

"github.com/rancherfederal/hauler/cmd/hauler/cli/download"
)

func addDownload(parent *cobra.Command) {
o := &download.Opts{}

cmd := &cobra.Command{
Use: "download",
Short: "Download OCI content from a registry and populate it on disk",
Aliases: []string{"dl"},
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, arg []string) error {
ctx := cmd.Context()

return download.Cmd(ctx, o, arg[0])
},
}
o.AddArgs(cmd)

parent.AddCommand(cmd)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package get
package download

import (
"context"
Expand Down Expand Up @@ -29,7 +29,7 @@ func (o *Opts) AddArgs(cmd *cobra.Command) {

func Cmd(ctx context.Context, o *Opts, reference string) error {
l := log.FromContext(ctx)
l.Debugf("running command `hauler get`")
l.Debugf("running command `hauler download`")

cs := content.NewFileStore(o.DestinationDir)
defer cs.Close()
Expand Down
25 changes: 0 additions & 25 deletions cmd/hauler/cli/get.go

This file was deleted.

29 changes: 0 additions & 29 deletions cmd/hauler/cli/load.go

This file was deleted.

30 changes: 0 additions & 30 deletions cmd/hauler/cli/save.go

This file was deleted.

29 changes: 0 additions & 29 deletions cmd/hauler/cli/serve.go

This file was deleted.

Loading