mirror of
https://github.com/ddworken/hishtory.git
synced 2024-11-25 17:53:24 +01:00
Add command to create a custom column
This commit is contained in:
parent
07e4c781e4
commit
f8c822bab5
11
hishtory.go
11
hishtory.go
@ -143,6 +143,17 @@ func main() {
|
||||
default:
|
||||
log.Fatalf("Unrecognized config key: %s", key)
|
||||
}
|
||||
case "add-custom-column":
|
||||
// TODO: implement a way of deleting a custom column
|
||||
columnName := os.Args[2]
|
||||
command := os.Args[3]
|
||||
ctx := hctx.MakeContext()
|
||||
config := hctx.GetConf(ctx)
|
||||
if config.CustomColumns == nil {
|
||||
config.CustomColumns = make([]hctx.CustomColumnDefinition, 0)
|
||||
}
|
||||
config.CustomColumns = append(config.CustomColumns, hctx.CustomColumnDefinition{ColumnName: columnName, ColumnCommand: command})
|
||||
lib.CheckFatalError(hctx.SetConfig(config))
|
||||
case "reupload":
|
||||
// Purposefully undocumented since this command is generally not necessary to run
|
||||
lib.CheckFatalError(lib.Reupload(hctx.MakeContext()))
|
||||
|
Loading…
Reference in New Issue
Block a user