mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-13 16:57:23 +02:00
Add help command
This commit is contained in:
@ -124,6 +124,7 @@ func TestParameterized(t *testing.T) {
|
||||
t.Run("testRequestAndReceiveDbDump/"+tester.ShellName(), func(t *testing.T) { testRequestAndReceiveDbDump(t, tester) })
|
||||
t.Run("testInstallViaPythonScript/"+tester.ShellName(), func(t *testing.T) { testInstallViaPythonScript(t, tester) })
|
||||
t.Run("testExportWithQuery/"+tester.ShellName(), func(t *testing.T) { testExportWithQuery(t, tester) })
|
||||
t.Run("testHelpCommand/"+tester.ShellName(), func(t *testing.T) { testHelpCommand(t, tester) })
|
||||
}
|
||||
}
|
||||
|
||||
@ -1125,4 +1126,20 @@ echo thisisrecorded`)
|
||||
}
|
||||
}
|
||||
|
||||
func testHelpCommand(t *testing.T, tester shellTester) {
|
||||
// Setup
|
||||
defer shared.BackupAndRestore(t)()
|
||||
installHishtory(t, tester, "")
|
||||
|
||||
// Test the help command
|
||||
out := tester.RunInteractiveShell(t, `hishtory help`)
|
||||
if !strings.HasPrefix(out, "hishtory: Better shell history\n\nSupported commands:\n") {
|
||||
t.Fatalf("expected hishtory help to contain intro, actual=%#v", out)
|
||||
}
|
||||
out2 := tester.RunInteractiveShell(t, `hishtory -h`)
|
||||
if out != out2 {
|
||||
t.Fatalf("expected hishtory -h to equal help")
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: write a test that runs hishtroy export | grep -v pipefail and then see if that shows up in query/export, I think there is weird behavior here
|
||||
|
Reference in New Issue
Block a user