2023-06-13 19:06:18 +03:00
|
|
|
package cli
|
|
|
|
|
|
|
|
// This file exports package constructs for testing.
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/neilotoole/sq/cli/run"
|
|
|
|
)
|
|
|
|
|
2023-06-21 15:28:15 +03:00
|
|
|
var (
|
|
|
|
DoCompleteAddLocationFile = locCompListFiles
|
|
|
|
PreprocessFlagArgVars = preprocessFlagArgVars
|
|
|
|
LastHandlePart = lastHandlePart
|
|
|
|
GetVersionFromBrewFormula = getVersionFromBrewFormula
|
|
|
|
FetchBrewVersion = fetchBrewVersion
|
2023-06-13 19:06:18 +03:00
|
|
|
)
|
|
|
|
|
2024-01-15 06:56:54 +03:00
|
|
|
// DoTestParseLocStage is a helper to test the
|
2023-06-13 19:06:18 +03:00
|
|
|
// non-exported locCompletionHelper.locCompParseLoc method.
|
|
|
|
func DoTestParseLocStage(t testing.TB, ru *run.Run, loc string) (PlocStage, error) { //nolint:revive
|
|
|
|
ploc, err := locCompParseLoc(loc)
|
|
|
|
if err != nil {
|
|
|
|
return PlocInit, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return ploc.stageDone, nil
|
|
|
|
}
|
2023-06-21 15:28:15 +03:00
|
|
|
|
|
|
|
type PlocStage = plocStage
|
|
|
|
|
|
|
|
const (
|
|
|
|
PlocInit = plocInit
|
|
|
|
PlocScheme = plocScheme
|
|
|
|
PlocUser = plocUser
|
|
|
|
PlocPass = plocPass
|
|
|
|
PlocHostname = plocHostname
|
|
|
|
PlocHost = plocHost
|
|
|
|
PlocPath = plocPath
|
|
|
|
)
|