From upstream PR: https://github.com/urfave/cli/pull/1299 From: William Wilson Date: Tue, 31 Aug 2021 14:19:17 -0500 Subject: Make test case compatible with Go 1.17 As of Go 1.17, the go flag package will panic if given a syntactically invalid flag. This causes TestApp_RunAsSubCommandIncorrectUsage to panic and therefore fail. See https://golang.org/doc/go1.17#flag for more information. --- diff --git a/app_test.go b/app_test.go index 7c38f6048..76e211d68 100644 --- a/app_test.go +++ b/app_test.go @@ -476,18 +476,18 @@ func TestApp_RunAsSubCommandIncorrectUsage(t *testing.T) { a := App{ Name: "cmd", Flags: []Flag{ - &StringFlag{Name: "--foo"}, + &StringFlag{Name: "foo"}, }, Writer: bytes.NewBufferString(""), } set := flag.NewFlagSet("", flag.ContinueOnError) - _ = set.Parse([]string{"", "---foo"}) + _ = set.Parse([]string{"", "-bar"}) c := &Context{flagSet: set} err := a.RunAsSubcommand(c) - expect(t, err, errors.New("bad flag syntax: ---foo")) + expect(t, err.Error(), "flag provided but not defined: -bar") } func TestApp_CommandWithFlagBeforeTerminator(t *testing.T) { guix/log/gnu/installer/utils.scm'>logtreecommitdiff
path: root/gnu/installer/utils.scm
AgeCommit message (Expand)Author
2022-12-09installer: Print progress bars and such as soon as \r is read....Fixes <https://issues.guix.gnu.org/59922>. Previously progress bars and related things would be buffered by 'run-external-command-with-line-hooks' until \n is read. * gnu/installer/utils.scm (run-external-command-with-line-hooks): Use 'read-delimited' rather than 'get-line'. Pass 'concat as the last argument. (%display-line-hook): Remove. (run-command): Use 'display' instead of '%display-line-hook'. (%syslog-line-hook): Add "\n" when LINE doesn't end in \n. (%installer-log-line-hook): Do not add an extra newline. (installer-log-line): Add an extra newline. Ludovic Courtès
2022-10-20installer: Run the "guix system init" command in a PTY....Fixes: <https://issues.guix.gnu.org/55360> * gnu/installer/utils.scm (run-external-command-with-handler/tty): New procedure. (run-external-command-with-line-hooks, run-command): Add a TTY? argument. * gnu/installer/final.scm (install-system): Call run-command with TTY? argument set to #true. Mathieu Othacehe
2022-09-22installer: Move <secret> to utils and use it for crypt passwords....* gnu/installer/user.scm (<secret>, secret?, make-secret, secret-content): Move to utils.scm. * gnu/installer/utils.scm (<secret>, secret?, make-secret, secret-content): Moved from user.scm. * gnu/installer/newt/partition.scm (prompt-luks-passwords): Make password a <secret>. * gnu/installer/parted.scm (luks-format-and-open): Unwrap secret. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Josselin Poiret