mirror of
https://github.com/hauler-dev/hauler.git
synced 2026-05-18 23:28:31 +00:00
* updated load flag and related logs [breaking change] * fixed load flag typo * added remote file fetch to load * fixed merge/rebase typo --------- Signed-off-by: Zack Brady <zackbrady123@gmail.com>
22 lines
710 B
Go
22 lines
710 B
Go
package flags
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
"hauler.dev/go/hauler/pkg/consts"
|
|
)
|
|
|
|
type LoadOpts struct {
|
|
*StoreRootOpts
|
|
FileName []string
|
|
TempOverride string
|
|
}
|
|
|
|
func (o *LoadOpts) AddFlags(cmd *cobra.Command) {
|
|
f := cmd.Flags()
|
|
|
|
// On Unix systems, the default is $TMPDIR if non-empty, else /tmp
|
|
// On Windows, the default is GetTempPath, returning the first value from %TMP%, %TEMP%, %USERPROFILE%, or Windows directory
|
|
f.StringSliceVarP(&o.FileName, "filename", "f", []string{consts.DefaultHaulerArchiveName}, "(Optional) Specify the name of inputted haul(s)")
|
|
f.StringVarP(&o.TempOverride, "tempdir", "t", "", "(Optional) Override the default temporary directiory determined by the OS")
|
|
}
|