@@ -12,36 +12,18 @@ case class OptGroup private (value: Seq[Opt]) extends OptGroupApi
1212 derives upickle.ReadWriter {
1313 override def toString (): String = value.mkString(" (" , " , " , " )" )
1414
15- // /**
16- // * Unify multiple options into one option.
17- // * Same as `mkString(" ")`` on a options list of type `Seq[String].
18- // */
19- // def mkOpt(sep: String = " "): Opt = Opt(value*)
20-
2115 def isEmpty : Boolean = value.isEmpty
2216
2317 def containsPaths : Boolean = value.exists(_.containsPaths)
2418
2519 def head : Opt = value.head
26- @ deprecated
27- override def startsWithArg (prefix : String ): Boolean = internalStartsWith(prefix)
28- @ deprecated
29- def startsWithArg (prefix : os.Path ): Boolean = internalStartsWith(prefix)
30- @ deprecated
31- private inline def internalStartsWith (prefix : (String | os.Path )): Boolean =
32- value.headOption.exists {
33- head =>
34- (head, prefix) match {
35- case (h : String , s : String ) => h == s
36- case (h : os.Path , p : os.Path ) => h == p
37- case _ => false
38- }
39- }
20+
21+ def toStringSeq : Seq [String ] = value.map(_.toString)
4022}
4123
4224object OptGroup {
4325 @ targetName(" applyUnion" )
44- def apply (value : (Opt | Seq [Opt ])* ): OptGroup = OptGroup (value.flatMap {
26+ def apply (value : (Opt | Seq [Opt ])* ): OptGroup = new OptGroup (value.flatMap {
4527 case a : Opt => Seq (a)
4628 case s : Seq [Opt ] => s
4729 })
@@ -65,4 +47,3 @@ object OptGroup {
6547 OptGroup (s.flatMap(f(_).value))
6648
6749}
68-
0 commit comments