mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-16 18:01:46 +02:00
Quote initial commands to make it possible to easily use hishtory to find matching entries for already typed commands that contain flags (#251)
* Quote initial commands to make it possible to easily use hishtory to find matching entries for already typed commands that contain flags * Add test for quoting dashes * Fix test failures * More test fixes * Update goldens * Update goldens * Update goldens * Fix race condition * Fix test harness bug by swapping to splitn * Update goldens * Update golden * Update test
This commit is contained in:
@ -361,7 +361,7 @@ func stripShellPrefix(out string) string {
|
||||
|
||||
func stripRequiredPrefix(t *testing.T, out, prefix string) string {
|
||||
require.Contains(t, out, prefix)
|
||||
return strings.TrimSpace(strings.Split(out, prefix)[1])
|
||||
return strings.TrimSpace(strings.SplitN(out, prefix, 2)[1])
|
||||
}
|
||||
|
||||
func stripTuiCommandPrefix(t *testing.T, out string) string {
|
||||
|
Reference in New Issue
Block a user