From fd0096293383eb736ab7431dc0a1e2d2f2144f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 20 Dec 2020 13:21:31 +0100 Subject: [PATCH] cmd: Add PersistentPreRun where it's currently missing `lab ci view` now has the --merge-request flags that may be set in the config file. There's probably not much of a use case for setting any of the `lab mr edit` flags from the config, but pre-process the flags there as well anyway for consistency. --- cmd/ci_view.go | 1 + cmd/mr_edit.go | 1 + 2 files changed, 2 insertions(+) diff --git a/cmd/ci_view.go b/cmd/ci_view.go index 3a1841f2..6c693540 100644 --- a/cmd/ci_view.go +++ b/cmd/ci_view.go @@ -43,6 +43,7 @@ var ciViewCmd = &cobra.Command{ Supports vi style (hjkl,Gg) bindings and arrow keys for navigating jobs and logs. Feedback Encouraged!: https://github.com/zaquestion/lab/issues`, + PersistentPreRun: LabPersistentPreRun, Run: func(cmd *cobra.Command, args []string) { a := tview.NewApplication() defer recoverPanic(a) diff --git a/cmd/mr_edit.go b/cmd/mr_edit.go index c70c6950..8f1667d1 100644 --- a/cmd/mr_edit.go +++ b/cmd/mr_edit.go @@ -26,6 +26,7 @@ lab MR edit -m "new title" # update title lab MR edit -m "new title" -m "new desc" # update title & description lab MR edit -l newlabel --unlabel oldlabel # relabel MR lab MR edit : # update a comment on MR`, + PersistentPreRun: LabPersistentPreRun, Run: func(cmd *cobra.Command, args []string) { rn, idString, err := parseArgsRemoteAndProject(args) if err != nil {