set: Support clumped flags, e.g. set -eux.
* gash/built-ins/set.scm (main): Support clumped flags.
This commit is contained in:
parent
50473ac9d4
commit
25597a4bec
|
@ -1,5 +1,6 @@
|
|||
;;; Gash -- Guile As SHell
|
||||
;;; Copyright © 2018 Timothy Sample <samplet@ngyro.com>
|
||||
;;; Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of Gash.
|
||||
;;;
|
||||
|
@ -18,6 +19,7 @@
|
|||
|
||||
(define-module (gash built-ins set)
|
||||
#:use-module (gash environment)
|
||||
#:use-module (srfi srfi-26)
|
||||
#:use-module (ice-9 match))
|
||||
|
||||
;;; Commentary:
|
||||
|
@ -79,6 +81,14 @@
|
|||
EXIT_FAILURE))))
|
||||
((op . args)
|
||||
(match (string->list op)
|
||||
((#\- (? option-letter? chr) ...)
|
||||
(for-each (cut setopt! <> #t)
|
||||
(map (cut assoc-ref *option-letters* <>) chr))
|
||||
EXIT_SUCCESS)
|
||||
((#\+ (? option-letter? chr) ...)
|
||||
(for-each (cut setopt! <> #f)
|
||||
(map (cut assoc-ref *option-letters* <>) chr))
|
||||
EXIT_SUCCESS)
|
||||
((#\- (? option-letter? chr))
|
||||
(setopt! (assoc-ref *option-letters* chr) #t)
|
||||
(loop args))
|
||||
|
|
Loading…
Reference in New Issue